#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
long long n, m, MOD;
long long d[1005][105];
long long ten[1005];
long long ten2[1005];
int main() {
  long long i, j, k;
  cin >> n >> m >> MOD;
  ten[0] = ten2[0] = 1;
  for (i = 1; i <= n; i++)
    ten[i] = ten[i - 1] * 10, ten[i] %= m, ten2[i] = ten2[i - 1] * 10,
    ten2[i] %= MOD;
  for (i = 0; i <= 9; i++) d[0][i % m]++;
  for (i = 1; i < n; i++) {
    d[i - 1][0] = 1;
    for (j = 0; j < m; j++) {
      for (k = 0; k <= 9; k++) {
        if (i == n - 1 && k == 0) continue;
        d[i][(j + k * ten[i]) % m] += d[i - 1][j];
        d[i][(j + k * ten[i]) % m] %= MOD;
      }
    }
  }
  long long sum = 0;
  for (i = 1; i < m; i++) sum += d[n - 1][i], sum %= MOD;
  sum = (ten2[n] - ten2[n - 1]) - sum;
  sum = (sum % MOD + MOD) % MOD;
  cout << sum;
  return 0;
}
