#include <bits/stdc++.h>
using namespace std;
const int maxl = 1e3 + 5, maxk = 100 + 5;
long long n, k, mod;
long long f[maxl][maxk][2], pw[maxl];
int getint() {
  char ch;
  int res = 0, p;
  while (!isdigit(ch = getchar()) && (ch ^ '-'))
    ;
  p = ch == '-' ? ch = getchar(), -1 : 1;
  while (isdigit(ch)) res = (res << 3) + (res << 1) + (ch ^ 48), ch = getchar();
  return res * p;
}
int main() {
  cin >> n >> k >> mod;
  for (int i = (1); i <= (9); ++i) f[1][i % k][i % k == 0]++;
  f[1][0][0]++;
  pw[0] = 1;
  for (int i = (1); i <= (n); ++i) pw[i] = pw[i - 1] * 10 % k;
  for (int i = (2); i <= (n); ++i) {
    for (int s = (0); s <= (k - 1); ++s) {
      for (int d = (0); d <= (9); ++d) {
        if (i == n && !d) continue;
        long long ns = (s + pw[i - 1] * d) % k;
        (f[i][ns][1] += f[i - 1][s][1]) %= mod;
        if (d > 0 && !ns)
          (f[i][ns][1] += f[i - 1][s][0]) %= mod;
        else
          (f[i][ns][0] += f[i - 1][s][0]) %= mod;
      }
    }
  }
  long long ans = 0;
  for (int s = (0); s <= (k - 1); ++s) (ans += f[n][s][1]) %= mod;
  cout << ans << endl;
  return 0;
}
