#include <bits/stdc++.h>
using namespace std;
long long n, k, m, dp[(int)(2e4 + 4)][104], pow10m[(int)(2e4 + 4)],
    pow10k[(int)(2e4 + 4)], sol;
bitset<104> used[(int)(2e4 + 4)][2];
long long build_dp(int len, long long mod, bool notzero) {
  if (used[len][notzero][mod]) return dp[len][mod];
  if (len > n) return 0;
  if (notzero && mod == 0) return (len == n ? 1 : 9 * pow10m[n - len - 1]) % m;
  long long amm = 0;
  for (int d = 0; d < 10; ++d)
    amm = (amm + build_dp(len + 1, (mod + pow10k[len] * d) % k, notzero || d)) %
          m;
  dp[len][mod] = amm;
  used[len][notzero][mod] = 1;
  return amm;
}
int main() {
  cin >> n >> k >> m;
  pow10m[0] = 1;
  for (int i = 1; i < 1002; ++i) pow10m[i] = pow10m[i - 1] * 10 % m;
  pow10k[0] = 1;
  for (int i = 1; i < 1002; ++i) pow10k[i] = pow10k[i - 1] * 10 % k;
  cout << build_dp(0, 0, 0);
  return 0;
}
