#include <bits/stdc++.h>
using namespace std;
const int maxn = 1009;
const int maxm = 109;
int n, mod, k, f[maxn][maxm][2], p10[maxn];
inline void incm(int& a, int b) {
  a += b;
  if (a >= mod) a %= mod;
}
void pre() {
  p10[0] = 1;
  for (int i = 1; i < n; ++i) p10[i] = p10[i - 1] * 10 % k;
}
int dp() {
  memset(f, 0, sizeof(f));
  for (int i = 0; i < 10; ++i) incm(f[0][i % k][i == 0], 1);
  for (int i = 0; i < n - 1; ++i) {
    int t((i == n - 2) ? 9 : 10);
    incm(f[i + 1][0][0], (long long int)f[i][0][0] * t % mod);
    for (int d = 10 - t; d < 10; ++d)
      incm(f[i + 1][d * p10[i + 1] % k][d == 0], f[i][0][1]);
    for (int j = 1; j < k; ++j)
      for (int d = 10 - t; d < 10; ++d)
        incm(f[i + 1][(d * p10[i + 1] + j) % k][0], f[i][j][0]);
  }
  return f[n - 1][0][0];
}
int main() {
  cin >> n >> k >> mod;
  pre();
  cout << dp() << endl;
}
