#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
const int K = 105;
int n, k, mod, dp[N][N], bs[N], gs[N], ans;
signed main() {
  scanf("%d%d%d", &n, &k, &mod);
  bs[0] = gs[0] = 1;
  for (int i = 1; i <= n; i++)
    bs[i] = 1ll * bs[i - 1] * 10 % mod, gs[i] = 1ll * gs[i - 1] * 10 % k;
  for (int i = 1; i <= 9; i++) dp[1][i % k]++, dp[1][i % k] %= mod;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= k; j++)
      for (int d = (i == n); d <= 9; d++)
        (dp[i][(gs[i - 1] * d + j) % k] += dp[i - 1][j]) %= mod;
    for (int d = 1; d <= 9; d++) (dp[i][gs[i - 1] * d % k] += 1) %= mod;
  }
  ans = dp[n][0];
  for (int i = 1; i <= n - 1; i++)
    (ans += 9ll * bs[n - i - 1] % mod * dp[i][0] % mod) %= mod;
  printf("%d\n", ans % mod);
  return 0;
}
