#include <bits/stdc++.h>
int count(long long n) {
  int temp = 0;
  while (n > 0) {
    n /= 10;
    temp++;
  }
  return temp;
}
int main() {
  long long b[18], a[18];
  long long i, j;
  a[0] = 1;
  b[0] = 1;
  a[1] = 9;
  b[1] = 10;
  for (i = 2; i <= 18; i++) {
    b[i] = b[i - 1] * 10;
    a[i] = a[i - 1] * 10;
  }
  long long w, k, m;
  scanf("%I64d %I64d %I64d", &w, &m, &k);
  w /= k;
  long long S = count(m);
  a[S] = a[S] - (m - b[S - 1]);
  long long track = 0;
  while (a[S] * S <= w) {
    w = w - a[S] * S;
    track += a[S];
    S++;
  }
  printf("%I64d", track + w / S);
}
