#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 

int main(void){  
  long long a,b,n;
  while(cin>>a>>b>>n){
    long long s=0;
    bool second = false;
    int f[100]; //(int)((double)a*10/b)%10
    for(int i=0; i<n; i++){
      double c = (double)a / b * pow(10,(double)i+1) ;
      f[i] = (int)c%10;
      //if((int)c%10==0) break;
      if(f[i]==f[0]&&i!=0){
        for(int j=i; j<n; j++){
          s+=f[j%i];
        }
        break;
      }
      s += (int)c%10;
    }
    cout << s << endl;
  }
  return 0;

}