#include <bits/stdc++.h>
using namespace std;
int n, m, mod;
long long dp[1005][105][2];
long long f[1005];
int main() {
  scanf("%d%d%d", &n, &m, &mod);
  dp[0][0][0] = 1;
  f[0] = 1;
  for (int i = 1; i < 1005; ++i) f[i] = (f[i - 1] * 10) % m;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      for (int k = 0; k < 10; ++k) {
        if (i == n - 1 && k == 0) continue;
        int next = (j + k * f[i]) % m;
        if (next || !k) {
          dp[i + 1][next][0] += dp[i][j][0];
          dp[i + 1][next][0] %= mod;
        } else {
          dp[i + 1][next][1] += dp[i][j][0];
          dp[i + 1][next][1] %= mod;
        }
        dp[i + 1][next][1] += dp[i][j][1];
        dp[i + 1][next][1] %= mod;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < m; ++i) {
    ans += dp[n][i][1];
    ans %= mod;
  }
  printf("%I64d\n", ans);
  return 0;
}
