#include <bits/stdc++.h>
long long t1[100], t2[100], n, k, m, i, j, mod[10], o, s;
int main() {
  scanf("%I64d %I64d %I64d", &n, &k, &m);
  t1[0] = 1;
  for (i = 0; i < 10; i++) mod[i] = i % k;
  for (i = 1; i <= n; i++) {
    for (j = 0; j < 10; j++) {
      if (j == 0 && (i == n || i == 1)) continue;
      for (o = 0; o < k; o++) {
        t2[(o + mod[j]) % k] += t1[o];
      }
    }
    if (i != 1) {
      for (j = 1; j < 10; j++) {
        t2[mod[j]]++;
      }
    }
    s += t2[0];
    t2[0] = 0;
    t1[0] = 0;
    if (i != n) {
      if (i == n - 1)
        s *= 9;
      else
        s *= 10;
      s %= m;
    }
    for (j = 1; j < k; j++) {
      t1[j] = t2[j] % m;
      t2[j] = 0;
    }
    for (j = 0; j < 10; j++) mod[j] = (mod[j] * 10) % k;
  }
  s %= m;
  printf("%I64d\n", s);
  return 0;
}
