#include <bits/stdc++.h>
using namespace std;
const int max_n = 1000, max_k = 100;
int dp[max_n][max_k];
int p[max_n + 5];
int main() {
  int n, k, mod;
  cin >> n >> k >> mod;
  p[0] = 10 % k;
  for (int i = 0; i < n; i++) p[i + 1] = p[i] * 10 % k;
  memset(dp, 0, sizeof dp);
  for (int dig = 1; dig < 10; dig++)
    dp[0][dig % k] = (1 + dp[0][dig % k]) % mod;
  for (int i = 0; i < n - 1; i++)
    for (int dig = (i + 1 == n - 1); dig < 10; dig++) {
      if (dig) {
        int newr = dig * p[i] % k;
        dp[i + 1][newr] = (1 + dp[i + 1][newr]) % mod;
      }
      for (int r = 0; r < k; r++) {
        int newr = r ? (dig * p[i] + r) % k : 0;
        dp[i + 1][newr] = (dp[i][r] + dp[i + 1][newr]) % mod;
      }
    }
  cout << dp[n - 1][0] << endl;
  return 0;
}
