#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000;
const int MAXK = 100;
int pow10m[MAXN + 1];
int pow10k[MAXN + 1];
int dp[MAXN + 1][MAXK + 1][2];
int solve(int id, int re, bool change, const int& n, const int& k,
          const int& m) {
  if (re == 0 && change)
    return (id != n ? ((pow10m[n - id - 1] * 9LL) % m) : 1);
  if (id == n) return 0;
  if (dp[id][re][change] != -1)
    return dp[id][re][change];
  else {
    long long temp = 0;
    for (int d = 0; d <= 9; ++d) {
      temp += solve(id + 1, (re + (d * 1LL * pow10k[id]) % k) % k,
                    (change || d != 0), n, k, m);
      temp %= m;
    }
    temp %= m;
    dp[id][re][change] = static_cast<int>(temp);
    return dp[id][re][change];
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k, m;
  cin >> n >> k >> m;
  pow10m[0] = 1 % m;
  for (int i = 1; i <= n; ++i) {
    long long temp = (pow10m[i - 1] * 10LL) % m;
    pow10m[i] = static_cast<int>(temp);
  }
  pow10k[0] = 1 % k;
  for (int i = 1; i <= n; ++i) {
    long long temp = (pow10k[i - 1] * 10LL) % k;
    pow10k[i] = static_cast<int>(temp);
  }
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0, 0, n, k, m);
  return 0;
}
