#include <bits/stdc++.h>
using namespace std;
const long long infl = 1e18 + 5;
long long int m, n, p, q, x, y, k, mx = -1, mn = infl, f, val, sz, sm, cnt, ans,
                                   t = 1, i, j, ind = -1;
long long int dp[1004][102][2], dp1[1004], pw[1004];
long long int rec(int ind, int st, int isz) {
  if (ind == 0) {
    if (st == 0 && isz == 1) return 1;
    return 0;
  }
  if (st == 0 && isz == 1 && ind != n) {
    return dp1[ind];
  }
  if (dp[ind][st][isz] != -1) return dp[ind][st][isz];
  int re = 0;
  int i, start = 0;
  for (i = start; i < 10; i++) {
    re += rec(ind - 1, (i * pw[n - ind + 1] + st) % k, isz || i != 0);
    re %= m;
  }
  dp[ind][st][isz] = re;
  return re;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("inp.txt", "r")) {
    freopen("myfile.txt", "w", stdout);
    freopen("inp.txt", "r", stdin);
  }
  memset(dp, -1, sizeof(dp));
  cin >> n >> k >> m;
  dp1[1] = 9 % m;
  pw[1] = 1 % k;
  for (i = 2; i < 1004; i++) {
    pw[i] = 10 * pw[i - 1];
    pw[i] %= k;
    dp1[i] = 10 * dp1[i - 1];
    dp1[i] %= m;
  }
  sz = rec(n, 0, 0);
  cout << sz;
  return 0;
}
