#include <iostream>
#include <deque>
#include <cstdlib>
#include <climits>
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;
      rem.push_back( a );
      qqq.push_back( q );
//      cout << i << " " << q << " " << a << endl;
      for( int j = 0; j < i; j++ ) {
        if( rem[ j ] == a ) {
          sp = j + 1;
          ep = i - 1;
        }
      }
      if( sp != INT_MAX ) { break; }
    }

    int sum_before_loop = 0;
    // to get sum x to y
    // [y + 1] - [x]
    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 if ( ep - sp == -1 ) {
      ans = sum_before_loop + sums_in_loop.back() * ( n - sp );
    } else {
     int loop_num = ( n - sp ) / ( ep - sp + 1 );
     int loop_rem = ( n - sp ) % ( ep - sp + 1 );
//     cout << loop_num << " " << loop_rem << " " << sums_in_loop.back() << endl;
//     cout << sum_before_loop << " " << sums_in_loop.back() << " " << loop_rem << " " << loop_num << endl;
      ans = sum_before_loop + sums_in_loop.back() * loop_num;
      ans += sums_in_loop[ loop_rem - 1 ];
      // sp = 2  ep = 4 n = 9 
      // 0 1 (2 3 4) (5 6 7) 8| 9 10
    }
    cout << ans << endl;
  }
  return EXIT_SUCCESS;
}