Problem

Given the three integers n, m, k

n1% 10 + n1 + m% 10 + n1 + 2m% 10 + ... + n1 + (k-1) m% 10

Calculate. a% b represents the remainder when a is divided by b.

Constraints

Input meets the following conditions

* 0 ≤ n ≤ 1018
* 0 ≤ m ≤ 109
* 1 ≤ k ≤ 109

Input


n m k


One line is given n, m, k.

Output

Print the answer on one line.

Examples

Input

1 1 9


Output

9


Input

2 1 3


Output

14


Input

6 11 11


Output

66


Input

100 7 12


Output

0


Input

123 123 3


Output

11
#include <iostream>
using namespace std;
 
typedef long long ll;
 
int main() {
  ll n,m,k;
  cin >> n >> m >> k;
  n%=10;
  m%=4;
 
  int a=n,d[4];
  for(int i=0; i<4; i++){
    d[i]=a;
    a=a*n%10;
  }
 
  ll ans=0;
  for(int i=0; i<4; i++) {
    ans+=k/4*d[m*i%4];
    if(i<k%4) ans+=d[m*i%4];
  }
  cout << ans << endl;
  return 0;
}
