#include <bits/stdc++.h>
using namespace std;
int n, m, k;
static const int N = 1001;
long long d[2][N + 1][N + 1];
long long pm[N + 1];
long long pk[N + 1];
long long funk(int i, int j, bool c) {
  if (j == 0 && c) {
    if (i == n)
      return 1;
    else
      return (1LL * pm[n - i - 1] * 9) % m;
  } else {
    if (d[c][i][j] == -1) {
      d[c][i][j] = 0;
      for (int x = 0; x < 10; x++) {
        d[c][i][j] += funk(i + 1, (1LL * pk[i] * x + j) % k, c || x);
        d[c][i][j] %= m;
      }
    }
    return d[c][i][j];
  }
}
int main() {
  scanf("%i", &n);
  scanf("%i", &k);
  scanf("%i", &m);
  for (int c = 0; c < 2; c++)
    for (int i = 0; i <= n; i++)
      for (int j = 0; j < k; j++) d[c][i][j] = -1;
  pm[0] = 1;
  pk[0] = 1;
  for (int i = 0; i < n; i++) {
    pm[i + 1] = (10 * pm[i]) % m;
    pk[i + 1] = (10 * pk[i]) % k;
  }
  cout << funk(0, 0, 0) << endl;
  return 0;
}
