#include <bits/stdc++.h>
using namespace std;
int inf = 2147483647;
const long long ll = 9223372036854775807;
int main() {
  long long num[20] = {};
  num[1] = 9;
  for (int i = 2; i <= 17; i++) {
    num[i] = num[i - 1] * 10;
  }
  long long a, b, c;
  while (cin >> a >> b >> c) {
    long long ans = 0;
    int now = log10(b) + 1;
    long long l = 0, r = num[now] - (b - num[now - 1]) + 1;
    long long maxr = 0;
    while (l <= r) {
      long long m = (l + r) / 2;
      if (double(double(c) * double(now) * double(m)) <= double(a)) {
        maxr = max(maxr, m);
        l = m + 1;
      } else {
        r = m - 1;
      }
    }
    ans += maxr;
    double tmp = (double(a) - (double(maxr) * double(c) * double(now)));
    a = tmp;
    for (int i = now + 1; i <= 16; i++) {
      l = 0, r = num[i];
      maxr = 0;
      if (double(a) < double(c) * double(i)) break;
      while (l <= r) {
        long long m = (l + r) / 2;
        if (double(double(c) * double(i) * double(m)) <= double(a)) {
          maxr = max(maxr, m);
          l = m + 1;
        } else {
          r = m - 1;
        }
      }
      ans += maxr;
      double tmp = (double(a) - (double(maxr) * double(c) * double(i)));
      a = tmp;
    }
    cout << ans << '\n';
  }
  return 0;
}
