#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010, MAXK = 105;
long long N, K, M, dp[MAXN][MAXK], p1[MAXN], p2[MAXN], ans;
int main() {
  if (fopen("D.in", "r")) freopen("D.in", "r", stdin);
  cin >> N >> K >> M;
  p1[0] = 1 % K;
  p2[0] = 1 % M;
  for (int i = 1; i < MAXN; i++) {
    p1[i] = (p1[i - 1] * 10) % K;
    p2[i] = (p2[i - 1] * 10) % M;
  }
  for (int i = 1; i <= 9; i++) {
    dp[1][i % K] = (dp[1][i % K] + 1) % M;
  }
  for (int i = 2; i <= N; i++) {
    for (int j = 0; j < K; j++) {
      for (int dig = 0; dig <= 9; dig++) {
        if (dig != 0 && (dig * p1[i - 1] % K == j))
          dp[i][j] = (dp[i][j] + 1) % M;
        long long nr = (j - (dig * p1[i - 1]) % K + K) % K;
        if (nr) dp[i][j] = (dp[i][j] + dp[i - 1][nr]) % M;
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    if (i == N)
      ans = (ans + dp[i][0]);
    else
      ans = (ans + dp[i][0] * p2[(N - i - 1)] % M * 9 % M) % M;
  }
  if (N == 1)
    cout << dp[N][0] << endl;
  else
    cout << ans % M << endl;
  return 0;
}
