#include <bits/stdc++.h>
using namespace std;
long long P = 1e9 + 7;
long long P1 = 1e9 + 9;
const int sqr = 500;
const int arrn = 4e6 + 5;
const int arrn2 = 6e3 + 5;
void solve() {
  int n, k, m;
  cin >> n >> k >> m;
  vector<vector<int>> cnt(n + 1, vector<int>(k, 0));
  for (int i = 0; i < 9; i++) {
    int rem = (i + 1) % k;
    if (rem < 0) rem += k;
    cnt[1][rem]++;
    cnt[1][rem] %= m;
  }
  for (int i = 2; i < n + 1; i++) {
    for (int r = 0; r < k; r++) {
      for (int e = 0; e < 10; e++) {
        int rem = (10 * r + e) % k;
        if (rem < 0) rem += k;
        cnt[i][rem] += cnt[i - 1][r];
        cnt[i][rem] %= m;
      }
    }
  }
  vector<int> fcnt(n + 1);
  for (int i = 1; i < n + 1; i++) fcnt[i] = cnt[i][0];
  long long cur = 10;
  for (int i = 1; i < n + 1; i++) {
    for (int j = i + 1; j < n + 1; j++) {
      long long tot = 0;
      for (int r = 0; r < k; r++) {
        if ((cur * r) % k == 0) {
          tot = (tot + cnt[j - i][r]) % m;
        }
      }
      fcnt[j] -= (tot * fcnt[i]) % m;
      fcnt[j] %= m;
    }
    cur = (cur * 10) % k;
  }
  int tot = fcnt[n];
  long long cpow = 9;
  for (int i = n - 1; i > 0; i--) {
    tot += (fcnt[i] * cpow) % m;
    tot %= m;
    cpow = (cpow * 10) % m;
  }
  if (tot < 0) tot += m;
  cout << tot;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
