#include <bits/stdc++.h>
const int MAXLEN = 1010;
const int MAXK = 110;
int n, K;
long long MOD, dp[MAXLEN][MAXK], ten[MAXLEN];
long long pow_mod(long long a, long long m) {
  if (m <= 0) return 1;
  if (m == 1) return a;
  long long t = pow_mod(a, m / 2);
  t = (t * t) % MOD;
  if (m & 1) t = (t * a) % MOD;
  return t;
}
long long work() {
  memset(dp, 0, sizeof dp);
  for (int i = 0; i < n; i++) {
    if (i == 0)
      ten[i] = 1 % K;
    else
      ten[i] = (10 * ten[i - 1]) % K;
  }
  for (int i = 1; i < 10; i++) dp[0][i % K] += 1;
  for (int p = 1; p < n; p++) {
    for (int m = 0; m < 10; m++) {
      if (m != 0) {
        dp[p][m * ten[p] % K]++;
        dp[p][m * ten[p] % K] %= MOD;
      }
      for (int k = 1; k < K; k++) {
        dp[p][(m * ten[p] + k) % K] += dp[p - 1][k];
        dp[p][(m * ten[p] + k) % K] %= MOD;
      }
    }
  }
  long long ans = 0;
  for (int p = 0; p < n; p++) {
    long long res = 0LL;
    if (p != n - 1) {
      res = dp[p][0] * pow_mod(10, n - p - 2) * 9;
    } else {
      res = dp[p][0];
    }
    ans += res;
    ans %= MOD;
  }
  return ans;
}
int main() {
  while (std::cin >> n >> K >> MOD) {
    std::cout << work() << std::endl;
  }
  return 0;
}
