#include <bits/stdc++.h>
using namespace std;
int n, k, m;
long long dp[1009][1900];
long long rm[1009];
long long pw[1009];
int main() {
  cin >> n >> k >> m;
  rm[0] = 1;
  pw[0] = 1;
  for (int i = 1; i <= 1001; i++) {
    rm[i] = (10 * rm[i - 1]) % k;
    pw[i] = (10 * pw[i - 1]) % m;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < k; j++)
      for (int x = 0; x <= 9; x++) {
        int rem = (rm[i - 1] * x + (i == 1 ? 0 : j)) % k;
        if (rem == 0 && x == 0) continue;
        dp[i][rem] += dp[i - 1][j];
        dp[i][rem] %= m;
      }
    for (int x = 1; x < 10; x++) {
      int rem = (rm[i - 1] * x) % k;
      dp[i][rem] += 1;
      dp[i][rem] %= m;
    }
    if (i < n) ans = (ans + dp[i][0] * (pw[max(n - i - 1, 0)] * 9) % m) % m;
    if (i == n) ans = (ans + dp[i][0]) % m;
  }
  cout << ans << endl;
  return 0;
}
