#include <bits/stdc++.h>
using namespace std;
long long arr[25];
int getlen(long long x) {
  int cnt = 0;
  while (x > 0) {
    x /= 10LL;
    cnt++;
  }
  return cnt;
}
int main() {
  long long w, m, k;
  cin >> w >> m >> k;
  arr[0] = 1;
  for (int i = 1; i <= 20; i++) {
    arr[i] = arr[i - 1] * 10LL;
  }
  int len = getlen(m);
  long long ans = 0;
  do {
    if ((arr[len] - m) * len <= (w / k)) {
      ans += (arr[len] - m);
      long long temp = w % k;
      w /= k;
      w -= ((arr[len] - m)) * len;
      w *= k;
      w += temp;
      m = arr[len];
      len++;
    } else {
      ans += (w / ((long long)len * k));
      w = 0;
    }
  } while (w > 0);
  cout << ans << endl;
  return 0;
}
