#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1000, MaxE = 100;
int n, k, cnt[MaxN + 5];
long long m, f[MaxN + 5][MaxE + 5], qwr[MaxN + 5];
void Get_Cnt() {
  cnt[0] = 1;
  for (int i = 1; i <= n; i++) cnt[i] = (cnt[i - 1] * 10) % k;
}
void Get_Qwr() {
  qwr[0] = 1;
  for (int i = 1; i <= n; i++) {
    qwr[i] = 9;
    for (int j = 1; j <= i - 1; j++) qwr[i] = (qwr[i] * 10) % m;
  }
}
int Cal(int x, int y, int z) { return (x + k - (y * cnt[z]) % k) % k; }
void Solve() {
  long long ans = 0;
  memset(f, 0, sizeof(f));
  for (int i = 1; i <= 9; i++) f[1][i % k]++;
  ans += (f[1][0] * qwr[n - 1]) % m;
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j < k; j++)
      for (int p = 0; p <= 9; p++) {
        if (Cal(j, p, i - 1) == 0)
          continue;
        else
          f[i][j] = (f[i][j] + f[i - 1][Cal(j, p, i - 1)]) % m;
      }
    for (int j = 1; j <= 9; j++)
      f[i][(j * cnt[i - 1]) % k] = (f[i][(j * cnt[i - 1]) % k] + 1) % m;
    ans = (ans + (f[i][0] * qwr[n - i])) % m;
  }
  printf("%I64d\n", ans);
}
int main() {
  scanf("%d%d%I64d", &n, &k, &m);
  Get_Cnt();
  Get_Qwr();
  Solve();
}
