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() {
  long double a, b;
  int n;
  while (cin >> a >> b >> n) {
    long double tmp = a / b;
    vector<int> digit;
    tmp -= (int)tmp;
    tmp *= 10;
    bool loop = true;
    int L = 0, R = 0;
    while (loop) {
      digit.push_back((int)tmp);
      for (int i = 0; i < digit.size(); i++) {
        int l = i;
        int len = digit.size() - i;
        int m = i - len;
        if (m <= 0) continue;
        int n = 0;
        for (; n < len; n++)
          if (digit[m + n] != digit[l + n]) break;
        if (n == len) {
          loop = false;
          L = i, R = digit.size() - 1;
          break;
        }
      }
      tmp -= (int)tmp;
      tmp *= 10;
    }
    int s = 0;
    int i = 0;
    int len = R - L + 1;
    for (; i < min(n, (int)digit.size()); i++) s += digit[i];
    while (i < n) {
      int num = 0;
      while (i < n && num < len) {
        s += digit[L + num];
        i++, num++;
      }
    }
    cout << s << '\n';
  }
}
