#include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 5;
const int K = 100 + 5;
int n, k, mod;
inline int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b; }
inline int sub(int a, int b) { return a - b < 0 ? a - b + mod : a - b; }
inline int mul(int a, int b) { return 1LL * a * b % mod; }
int dp[N][K][2], base10mod[N], base10k[N];
bool dped[N][K][2];
int go(int, int, bool);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> mod;
  base10mod[0] = base10k[0] = 1;
  for (int i = 1; i <= n; i++) base10mod[i] = mul(base10mod[i - 1], 10);
  for (int i = 1; i <= n; i++) base10k[i] = 1LL * base10k[i - 1] * 10 % k;
  cout << go(0, 0, 0) << '\n';
  return 0;
}
int go(int i, int j, bool any) {
  if (dped[i][j][any]) return dp[i][j][any];
  if (j == 0 and any) return i == n ? 1 : mul(base10mod[n - i - 1], 9);
  if (i == n) return 0;
  auto& ret = dp[i][j][any];
  dped[i][j][any] = true;
  for (int a = 0; a < 10; a++) {
    ret = add(ret, go(i + 1, (j + 1LL * a * base10k[i] % k) % k, any or a > 0));
  }
  return ret;
}
