#include <bits/stdc++.h>
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e3 + 5;
const double eps = 1e-9;
using namespace std;
long long dp[MAXN][MAXN][2];
long long pw[MAXN], p2[MAXN];
int n = 0, k = 0, m = 0;
long long solve(int i, int j, int fl) {
  if (j == 0 && fl != 0) return i != n ? pw[n - i - 1] * 9ll % m : 1ll;
  if (i == n) return 0;
  if (dp[i][j][fl] != -1) return dp[i][j][fl];
  dp[i][j][fl] = 0;
  for (int l = 0; l < 10; l++)
    dp[i][j][fl] = (dp[i][j][fl] +
                    solve(i + 1, (j + l * 1ll * p2[i] % k) % k, fl || l != 0)) %
                   m;
  return dp[i][j][fl];
}
int main() {
  for (int i = 0; i < MAXN; i++)
    for (int j = 0; j < MAXN; j++)
      for (int l = 0; l < 2; l++) dp[i][j][l] = -1;
  scanf("%d", &(n)), scanf("%d", &(k)), scanf("%d", &(m));
  pw[0] = 1 % m, p2[0] = 1 % k;
  for (int i = 1; i <= n; i++) pw[i] = pw[i - 1] * 10 % m;
  for (int i = 1; i <= n; i++) p2[i] = p2[i - 1] * 10 % k;
  printf("%I64d\n", (solve(0, 0, 0)));
  return 0;
}
