#include <bits/stdc++.h>
using namespace std;
int dp[1005][205], dp1[1005][105], a[1005], s[1005][105], s1[1005][105];
int main() {
  int n, k, m, i, j;
  cin >> n >> k >> m;
  a[1] = 1 % k;
  for (i = 2; i <= n; i++) {
    a[i] = (a[i - 1] * 10) % k;
  }
  dp1[0][0] = 1;
  s[0][0] = 1;
  for (i = 0; i <= 9; i++) {
    dp1[1][i % k]++;
  }
  for (i = 0; i < k; i++) s[1][i] = dp1[1][i];
  for (i = 2; i <= 1000; i++) {
    for (j = 0; j < k; j++) {
      for (int f = 1; f <= 9; f++) {
        dp1[i][((f * a[i] + j) % k + k) % k] += s[i - 1][j];
        dp1[i][((f * a[i] + j) % k + k) % k] %= m;
      }
    }
    for (j = 0; j < k; j++) {
      s[i][j] = s[i - 1][j] + dp1[i][j];
      s[i][j] %= m;
    }
  }
  dp[1][0] = 1;
  for (i = 1; i <= n; i++) {
    for (j = 0; j < k; j++) {
      for (int f = 1; f <= 9; f++) {
        if ((f * a[i] + j) % k == 0) {
          dp[i][0] += s[i - 1][j];
          dp[i][0] %= m;
        } else {
          dp[i][(f * a[i] + j) % k] += s1[i - 1][j];
          if (i > 1 && j == 0) dp[i][(f * a[i] + j) % k]--;
          dp[i][(f * a[i] + j) % k] %= m;
        }
      }
    }
    for (j = 0; j < k; j++) {
      s1[i][j] = s1[i - 1][j] + dp[i][j];
      s1[i][j] %= m;
    }
  }
  int ss = 0;
  for (i = 0; i < k; i++) {
    ss += dp[n][i];
    ss %= m;
  }
  if (n == 1) {
    ss--;
    ss = (ss % m + m) % m;
  }
  printf("%d\n", ss);
}
