#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

typedef long long lli;

int main() {
  lli a, b, n;
  while(cin >> a >> b >> n) {
    int ten = 1;
    int da = 0;
    while(a / ten) {
      ten *= 10;
      ++da;
    }
    ten /= 10;
    --da;
    int base = 0;
    while(da >= 0) {
      base += a / ten % 10;
      base %= b;
      base *= 10;
      ten /= 10;
      --da;
    }
    int sum = 0;
    for(int i = 0; i < n; ++i) {
      sum += base / b;
      base %= b;
      base *= 10;
    }
    cout << sum << endl;
  }
  return 0;
}