#include <bits/stdc++.h>
using namespace std;
int n, k, m;
int arr[1005][105][2], arr1[1005], arr2[1005];
long long dp(int i, int s, int hg) {
  if (s == 0 && hg) return ((i != n) ? ((9 * 1LL * arr2[n - i - 1]) % m) : 1);
  if (i == n) return 0;
  if (arr[i][s][hg] != -1) return arr[i][s][hg];
  arr[i][s][hg] = 0;
  for (int j = 0; j <= 9; j++) {
    arr[i][s][hg] +=
        dp(i + 1, (s + (j * 1LL * arr1[i]) % k) % k, (hg || (j != 0)));
    arr[i][s][hg] %= m;
  }
  return arr[i][s][hg];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  memset(arr, -1, sizeof(arr));
  cin >> n >> k >> m;
  arr1[0] = arr2[0] = 1;
  for (int i = 1; i <= 1000; i++) arr1[i] = (arr1[i - 1] * 1LL * 10) % k;
  for (int i = 1; i <= 1000; i++) arr2[i] = (arr2[i - 1] * 1LL * 10) % m;
  cout << dp(0, 0, 0) << "\n";
}
