#include <bits/stdc++.h>
using namespace std;
int n, k, m;
long long dp[1010][105], ten;
long long B[1010];
int main() {
  cin >> n >> k >> m;
  B[0] = 1LL;
  ten = 10LL;
  for (int i = 1; i < 1010; i++) {
    B[i] = (ten * B[i - 1]) % m;
  }
  long long ans = 0;
  ten = 1LL;
  for (int i = 0; i < n; i++) {
    if (i != 0) ten = (ten * 10LL) % k;
    for (int j = 1; j < k; j++) {
      if (dp[i][j] == 0) continue;
      for (int l = 0; l <= 9; l++) {
        int h = (j + ((long long)l * ten % k)) % k;
        dp[i + 1][h] = (dp[i + 1][h] + dp[i][j]) % m;
      }
    }
    for (int l = 1; l <= 9; l++) {
      int h = (0 + ((long long)l * ten % k)) % k;
      dp[i + 1][h] = (dp[i + 1][h] + 1LL) % m;
    }
  }
  for (int i = 1; i < n; i++) {
    ans = (ans + (((dp[i][0] * 9LL) % m * B[n - 1 - i]) % m)) % m;
  }
  ans = (ans + dp[n][0]) % m;
  cout << ans << endl;
  return 0;
}
