#include <bits/stdc++.h>
using namespace std;
int n, m, k;
long long dp[1500][150][2];
int solve(int idx, int rem, bool found, int power) {
  if (idx >= n) return found;
  if (dp[idx][rem][found] != -1) return dp[idx][rem][found];
  int sum = 0;
  int i;
  if (idx == n - 1)
    i = 1;
  else
    i = 0;
  for (; i <= 9; i++) {
    int x = (rem + i * power) % k;
    sum += solve(idx + 1, x, found || (x == 0 && i != 0), (power * 10) % k);
    sum %= m;
  }
  return dp[idx][rem][found] = sum % m;
}
int main() {
  cin >> n >> k >> m;
  memset(dp, -1, sizeof dp);
  cout << solve(0, 0, 0, 1) << endl;
  return 0;
}
