#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double eps = 1e-12;
const int inf = 200000000;
const long long int infLL = 2e18;
long long int MOD = 1000000007;
int MOD1 = 1000000007;
int MOD2 = 1000000009;
inline bool checkBit(long long int n, long long int i) {
  return n & (1LL << i);
}
inline long long int setBit(long long int n, long long int i) {
  return n | (1LL << i);
  ;
}
inline long long int resetBit(long long int n, long long int i) {
  return n & (~(1LL << i));
}
void yes() { cout << "YES" << '\n'; }
void no() { cout << "NO" << '\n'; }
int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline bool isLeapYear(long long int year) {
  return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}
inline void normal(long long int &a) {
  a %= MOD;
  (a < 0) && (a += MOD);
}
inline long long int modMul(long long int a, long long int b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  return (a * b) % MOD;
}
inline long long int modAdd(long long int a, long long int b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  return (a + b) % MOD;
}
inline long long int modSub(long long int a, long long int b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  a -= b;
  normal(a);
  return a;
}
inline long long int modPow(long long int b, long long int p) {
  long long int r = 1LL;
  while (p) {
    if (p & 1) r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1LL;
  }
  return r;
}
inline long long int modDiv(long long int a, long long int b) {
  return modMul(a, modPow(b, MOD - 2));
}
long long int dp[1001][105][2];
long long int pw[1005];
long long int n, k, mod;
long long int solve(int idx, int rem, int oka) {
  if (idx < 0) {
    if (oka == 1)
      return 1;
    else
      return 0;
  }
  if (dp[idx][rem][oka] != -1) return dp[idx][rem][oka];
  long long int ret = 0LL;
  if (idx == 0) {
    for (long long int i = 1; i <= 9; ++i) {
      long long int cur = (i * pw[n - idx] + rem) % k;
      if (cur == 0) {
        ret = ret + solve(idx - 1, cur, 1);
        ret %= mod;
      } else {
        ret = ret + solve(idx - 1, cur, oka);
        ret %= mod;
      }
    }
  } else {
    if (oka == false) {
      for (long long int i = 0; i <= 9; ++i) {
        long long int cur = (i * pw[n - idx] + rem) % k;
        if ((cur == 0 && i != 0) || (i == 0 && rem != 0 && cur == 0))
          ret = ret + solve(idx - 1, cur, 1), ret %= mod;
        else
          ret = ret + solve(idx - 1, cur, 0), ret %= mod;
      }
    } else
      ret = (10LL * solve(idx - 1, rem, 1)) % mod;
  }
  return dp[idx][rem][oka] = ret % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k >> mod;
  pw[1] = 1LL;
  for (long long int i = 2; i <= 1000; ++i) pw[i] = (pw[i - 1] * 10LL) % k;
  memset(dp, -1, sizeof(dp));
  cout << solve(n - 1, 0, 0) << '\n';
  return 0;
}
