#include <bits/stdc++.h>
using namespace std;
int dp[1005];
int cnt[1005][105];
int pow_10[1005];
int main() {
  int n, k, m;
  map<int, int> mp;
  scanf("%d", &n);
  scanf("%d", &k);
  scanf("%d", &m);
  pow_10[0] = 1 % k;
  for (int i = 1; i <= n; i++) pow_10[i] = (pow_10[i - 1] * 10LL) % k;
  dp[0] = 1;
  dp[1] = 9;
  for (int i = 2; i <= n; i++) dp[i] = (dp[i - 1] * 1LL * 10) % m;
  int ans = 0;
  memset(cnt, 0, sizeof cnt);
  for (int i = 1; i <= 9; i++) cnt[1][i % k]++;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= k; j++)
      for (int next = 0; next < 10; next++) {
        int temp = (next * 1LL * pow_10[i - 1] + j) % k;
        cnt[i][temp] = (cnt[i][temp] + cnt[i - 1][j]) % m;
      }
    for (int next = 1; next <= 9; next++) {
      int temp = (next * 1LL * pow_10[i - 1]) % k;
      cnt[i][temp] = (cnt[i][temp] + 1) % m;
    }
  }
  for (int len = 1; len <= n; len++)
    ans = (ans + (dp[n - len] * 1LL * cnt[len][0]) % m) % m;
  printf("%d\n", ans);
  return 0;
}
