#include <bits/stdc++.h>
using namespace std;
long long int arr[2000];
void set_arr() {
  int l = 1;
  arr[0] = 9;
  while (arr[l - 1] < 1e17) {
    arr[l] = arr[l - 1] * 10 + 9;
    l++;
  }
}
int main() {
  set_arr();
  int n, tem1, tem2;
  string s, c;
  long long w, m, k, ans = 0, sum = 0;
  cin >> w >> m >> k;
  stringstream ss;
  ss << m;
  string str = ss.str();
  tem1 = str.length();
  int i = 1;
  while (1) {
    long long req = w / k / (tem1);
    if ((req <= arr[tem1 - 1]) && (m - 1 + req <= arr[tem1 - 1])) {
      cout << req + ans;
      break;
    } else {
      ans += arr[tem1 - 1] - m + 1;
      w -= k * (arr[tem1 - 1] - m + 1) * (tem1);
      m = arr[tem1 - 1] + 1;
    }
    tem1++;
  }
  return 0;
}
