#include <bits/stdc++.h>
int main() {
  long long n, m, k, i, j = 0, s = 0;
  scanf("%lld %lld %lld", &n, &m, &k);
  n /= k;
  for (i = 1; i <= m; i *= 10) j++;
  for (; (i - m) * j < n; j++) {
    n -= (i - m) * j;
    s += i - m;
    m = i;
    i *= 10;
  }
  printf("%lld\n", s + n / j);
  return 0;
}
