#include <bits/stdc++.h>
using namespace std;
long long d[1001], f[1001][101];
long long C[10][1001];
void init(int n, int k) {
  for (int j = 1; j < 10; j++) {
    C[j][1] = j % k;
    for (int i = 2; i <= n; i++) {
      C[j][i] = (C[j][i - 1] * 10) % k;
    }
  }
}
int main() {
  int n, k, m, i;
  cin >> n >> k >> m;
  init(n, k);
  for (int i = 1; i < 10; i++) {
    d[1] += (i % k == 0);
    if (i % k != 0) f[1][i % k]++;
  }
  if (n == 1) {
    cout << d[1] % m << endl;
    return 0;
  }
  for (i = 2; i < n; i++) {
    d[i] = (d[i - 1] * 10) % m;
    for (int j = 1; j <= 9; j++) {
      int s = k - C[j][i];
      d[i] = (d[i] + f[i - 1][s]) % m;
      if (C[j][i] == 0)
        d[i] = (d[i] + 1) % m;
      else
        f[i][C[j][i]]++;
    }
    for (int j = 1; j < k; j++) {
      for (int t = 0; t < 10; t++) {
        int s = (j - C[t][i] + k) % k;
        f[i][j] = (f[i][j] + f[i - 1][s]) % m;
      }
    }
  }
  d[i] = (d[i - 1] * 9) % m;
  for (int j = 1; j <= 9; j++) {
    int s = (k - C[j][i]) % k;
    d[i] = (d[i] + f[i - 1][s]) % m;
    if (C[j][i] == 0) d[i] = (d[i] + 1) % m;
  }
  cout << d[n] << endl;
  return 0;
}
