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 get_sum(deque<int> &q, int sp, int ep) { return (q[ep + 1] - q[sp]); }
int main() {
  int a, b, n;
  while (cin >> a) {
    cin >> b >> n;
    int i, q;
    int sp = INT_MAX, ep = INT_MAX;
    deque<int> qqq;
    deque<int> rem;
    a %= b;
    a *= 10;
    for (i = 0; a > 0; a *= 10, i++) {
      q = a / b;
      a %= b;
      for (int j = 0; j < i; j++) {
        if (rem[j] == a) {
          sp = j;
          ep = i - 1;
        }
      }
      if (sp != INT_MAX) {
        break;
      }
      rem.push_back(a);
      qqq.push_back(q);
    }
    int sum_before_loop = 0;
    deque<int> sums_in_loop;
    sums_in_loop.push_back(0);
    for (int j = 0; j < i; j++) {
      if (j < sp) {
        sum_before_loop += qqq[j];
      } else {
        sums_in_loop.push_back(sums_in_loop.back() + qqq[j]);
      }
    }
    int ans = 0;
    if (i == 0) {
      ans = 0;
    } else if (sp == INT_MAX) {
      ans = sum_before_loop;
    } else {
      int loop_num = (n - sp) / (ep - sp + 1);
      int loop_rem = (n - sp) % (ep - sp + 1);
      ans = sums_in_loop.back() * loop_num +
            get_sum(sums_in_loop, sp, sp + loop_rem - 1);
    }
    cout << ans << endl;
  }
  return EXIT_SUCCESS;
}
