Assume that a, b, and n are all positive integers. Let f (i) be the i-th fraction of the fraction a / b (0 ≤ f (i) ≤ 9). At this time, let s be the sum of f (i) from i = 1 to n.

s = f (1) + f (2) + ... + f (n)


Create a program that reads a, b, n, outputs s, and exits.



Input

The input consists of multiple datasets. For each dataset, three integers a (1 ≤ a ≤ 1000), b (1 ≤ b ≤ 10000), n (1 ≤ n ≤ 100) are given on one line, separated by blanks.

The number of datasets does not exceed 100.

Output

Prints s on one line for each dataset.

Example

Input

1 2 3
2 3 4
5 4 3
4 3 2


Output

5
24
7
6
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, n;
  while (cin >> a) {
    cin >> b >> n;
    int i, r;
    set<int> rems;
    deque<int> q;
    deque<int> ssum;
    a %= b;
    for (i = 0;; i++) {
      a *= 10;
      r = a / b;
      if (rems.find(r) != rems.end() || r == 0) {
        break;
      }
      rems.insert(r);
      q.push_back(r);
      ssum.push_back(i == 0 ? r : ssum[i - 1] + r);
      a -= r * b;
    }
    int looplen = q.size();
    int ans = 0;
    if (looplen == 0) {
      ans = 0;
    } else if (r == 0) {
      ans = ssum[min(i - 1, n - 1)];
    } else {
      ans = ssum.back() * (n / looplen);
      ans += (n % looplen == 0 ? 0 : ssum[n % looplen - 1]);
    }
    cout << ans << endl;
  }
  return EXIT_SUCCESS;
}
