#include <bits/stdc++.h>
using namespace std;
long long modpow(long long b, long long e, long long m) {
  b %= m;
  if (e == 0) return 1;
  if (e % 2 == 1) return (b * modpow(b, e - 1, m)) % m;
  return modpow((b * b) % m, e / 2, m);
}
long long powten[1005];
vector<long long> mods;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k, m;
  cin >> n >> k >> m;
  for (int i = 0; i < 1005; i++) {
    if (i == 0)
      powten[i] = 1;
    else
      powten[i] = (10 * powten[i - 1]) % k;
  }
  mods.resize(k, 0);
  for (int i = 0; i < 10; i++) {
    if (i % k != 0 or i == 0) mods[i % k] = (mods[i % k] + 1) % m;
  }
  for (int i = 1; i < n; i++) {
    vector<long long> temp;
    temp.resize(k, 0);
    for (int j = 0; j < 10; j++) {
      if (i == n - 1 and j == 0) continue;
      long long del = (j * powten[i]) % k;
      for (int prev = 0; prev < k; prev++)
        temp[(prev + del) % k] = (temp[(prev + del) % k] + mods[prev]) % m;
    }
    temp[0] = ((i == n - 1) ? 0 : 1);
    mods = temp;
  }
  if (n == 1) mods[0] = 0;
  long long total = (9 * modpow(10, n - 1, m)) % m;
  for (int i = 0; i < k; i++) total = (total - mods[i] + m) % m;
  cout << total << '\n';
  return 0;
}
