#include <cstdio>
using namespace std;
typedef long long lint;
int main()
{
lint N, M, K;
lint S[20];
scanf("%I64d %I64d %I64d", &N, &M, &K);
N /= K;
lint base = 9;
for (int i = 0; i < 17; i++){
S[i] = (i + 1) * base; base *= 10;
}
base = 10;
for (int i = 0; i < 17; i++){
if (M >= base){
N += S[i];
}
else {
N += (M - base / 10) * (i + 1);
break;
}
base *= 10;
}
base = 9;
lint A = 0;
for (int i = 0; i < 17; i++){
if (N >= S[i]){
A += base;
N -= S[i];
}
else {
A += N / (i + 1);
break;
}
base *= 10;
}
printf("%I64d\n", A - M + 1);
return (0);
}
I2luY2x1ZGUgPGNzdGRpbz4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0eXBlZGVmIGxvbmcgbG9uZyBsaW50OwoKaW50IG1haW4oKQp7CiAgICBsaW50IE4sIE0sIEs7CiAgICBsaW50IFNbMjBdOwogICAgCiAgICBzY2FuZigiJUk2NGQgJUk2NGQgJUk2NGQiLCAmTiwgJk0sICZLKTsKICAgIAogICAgTiAvPSBLOwogICAgCiAgICBsaW50IGJhc2UgPSA5OwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCAxNzsgaSsrKXsKICAgICAgICBTW2ldID0gKGkgKyAxKSAqIGJhc2U7IGJhc2UgKj0gMTA7CiAgICB9CiAgICAKICAgIGJhc2UgPSAxMDsKICAgIAogICAgZm9yIChpbnQgaSA9IDA7IGkgPCAxNzsgaSsrKXsKICAgICAgICBpZiAoTSA+PSBiYXNlKXsKICAgICAgICAgICAgTiArPSBTW2ldOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgTiArPSAoTSAtIGJhc2UgLyAxMCkgKiAoaSArIDEpOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgYmFzZSAqPSAxMDsKICAgIH0KICAgIAogICAgYmFzZSA9IDk7CiAgICBsaW50IEEgPSAwOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCAxNzsgaSsrKXsKICAgICAgICBpZiAoTiA+PSBTW2ldKXsKICAgICAgICAgICAgQSArPSBiYXNlOwogICAgICAgICAgICBOIC09IFNbaV07CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBBICs9IE4gLyAoaSArIDEpOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgYmFzZSAqPSAxMDsKICAgIH0KICAgIAogICAgcHJpbnRmKCIlSTY0ZFxuIiwgQSAtIE0gKyAxKTsKICAgIAogICAgcmV0dXJuICgwKTsKfQ==