#include <bits/stdc++.h>
using namespace std;
long long w, m, k;
long long comp;
long long getpre(long long a) {
  long long tmp = 1, ct = 0;
  while (a >= tmp) tmp *= 10, ++ct;
  tmp /= 10;
  long long t = 1;
  long long ans = 0;
  for (long long i = 1; i < ct; ++i) ans += i * 9 * t, t *= 10;
  ans += (a - tmp + 1) * ct;
  return ans;
}
bool judge(long long len) {
  long long tl = m - 1;
  long long tr = m + len - 1;
  if (getpre(tr) - getpre(tl) <= comp) return true;
  return false;
}
int main() {
  cin >> w >> m >> k;
  long long l = 0, r = w / k + 1, ans = 0;
  comp = r - 1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (judge(mid))
      l = mid + 1, ans = mid;
    else
      r = mid - 1;
  }
  cout << ans << endl;
}
