#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T SQR(T x) {
  return x * x;
}
template <class T>
inline string TOSTR(const T &x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
template <class T>
void UPDATE_MIN(T &x, T y) {
  if (y < x) {
    x = y;
  }
}
template <class T>
void UPDATE_MAX(T &x, T y) {
  if (x < y) {
    x = y;
  }
}
int gcd(int a, int b) { return a ? gcd(b % a, a) : b; }
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
long long powmod(long long a, long long p, long long m) {
  long long r = 1;
  while (p) {
    if (p & 1) r = r * a % m;
    p >>= 1;
    a = a * a % m;
  }
  return r;
}
const int MOD = 1000 * 1000 * 1000 + 7;
const double PI = 3.1415926535897932384626433832795l;
long long n, m, k;
long long p10[10000];
long long p9_10[10000];
long long counts_a[100] = {};
long long counts_b[100] = {};
long long *counts, *counts2;
int main() {
  cin >> n >> k >> m;
  long long a10 = 1, a9_10 = 1;
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    p10[i] = a10;
    p9_10[i] = a9_10;
    a10 = (a10 * 10LL) % k;
    a9_10 = (a9_10 * ((i == 0) ? 9LL : 10LL)) % m;
  }
  counts = counts_a;
  counts2 = counts_b;
  counts[0] = 1;
  long long res = 0;
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    for (int(j) = 0; (j) < (int)(k); (j)++) counts2[j] = 0;
    for (int(r) = 0; (r) < (int)(k); (r)++) {
      int mind = ((i == n) ? 1 : 0);
      for (int(d) = mind; (d) < (int)(10); (d)++) {
        long long r2 = (d * p10[i] + r) % k;
        counts2[r2] = (counts2[r2] + counts[r]) % m;
      }
    }
    res += (counts2[0] - 1) * p9_10[n - i - 1];
    res %= m;
    while (res < 0) res += m;
    counts2[0] = 1;
    {
      __typeof(counts) tmp = counts;
      counts = counts2;
      counts2 = tmp;
    };
  }
  cout << res << endl;
  return 0;
}
