#include <bits/stdc++.h>
using namespace std;
long long MOD;
void add(long long& x, long long y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
void take(long long& x, long long y) {
  x -= y;
  if (x < 0) x += MOD;
}
long long sum(long long a, long long b) {
  add(a, b);
  return a;
}
long long sub(long long a, long long b) {
  take(a, b);
  return a;
}
long long mul(long long x, long long y) { return (x * y) % MOD; }
int main() {
  cout << setprecision(20);
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, k, m;
  cin >> n >> k >> m;
  MOD = m;
  vector<long long> pow10(n + 10);
  pow10[0] = 1;
  vector<long long> pow10modk(n + 10);
  pow10modk[0] = 1;
  for (int i = 1; i < n + 6; ++i) {
    pow10[i] = mul(10LL, pow10[i - 1]);
    pow10modk[i] = (10LL * pow10modk[i - 1]) % k;
  }
  vector<vector<long long>> dp(n, vector<long long>(k));
  for (int i = 1; i < 10; ++i) {
    add(dp[0][i % k], 1);
  }
  long long cf = mul(9, pow10[n - 2]);
  long long ans = n == 1 ? dp[0][0] : mul(dp[0][0], cf);
  for (int i = 1; i < n; ++i) {
    for (long long digit = (i < n - 1 ? 0 : 1); digit < 10; ++digit) {
      for (long long rem = 1; rem < k; ++rem) {
        long long rem1 = (rem + digit * pow10modk[i]) % k;
        add(dp[i][rem1], dp[i - 1][rem]);
      }
    }
    for (long long digit = 1; digit < 10; ++digit) {
      long long rem1 = (digit * pow10modk[i]) % k;
      add(dp[i][rem1], 1);
    }
    long long coef =
        mul((i < (n - 1) ? 9LL : 1LL) % m, pow10[max(0LL, n - 2 - i)]);
    add(ans, mul(dp[i][0], coef));
  }
  cout << ans;
  return 0;
}
