#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int sum = 0, ff = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') ff = -1;
    ch = getchar();
  }
  while (isdigit(ch)) sum = sum * 10 + (ch ^ 48), ch = getchar();
  return sum * ff;
}
const int mod = 1e9 + 7;
const int mo = 998244353;
const int N = 1e3 + 5;
int n, m, f[N][101][2], j10[N], ans, MO;
inline void Add(int &x, int y) {
  if (y >= MO) y -= MO;
  x += y;
  if (x >= MO) x -= MO;
}
int main() {
  n = read();
  m = read();
  MO = read();
  j10[0] = 1;
  for (int i = (1); i <= (n); i++) j10[i] = j10[i - 1] * 10 % m;
  f[0][0][0] = 1;
  for (int i = (0); i <= (n - 1); i++)
    for (int j = (0); j <= (m - 1); j++)
      for (int k = ((i == n - 1) ? 1 : 0); k <= (9); k++) {
        int s = (j + k * j10[i]) % m;
        Add(f[i + 1][s][1], f[i][j][1]);
        if (!s && k)
          Add(f[i + 1][s][1], f[i][j][0]);
        else
          Add(f[i + 1][s][0], f[i][j][0]);
      }
  int ans = 0;
  for (int j = (0); j <= (m - 1); j++) Add(ans, f[n][j][1]);
  printf("%d\n", ans);
  return 0;
}
