#include <bits/stdc++.h>
using namespace std;
long long dp[2000][200], dp1[2000][200];
long long ten[2000], tenM[2000];
inline long long domod(long long a, long long b) {
  a %= b;
  if (a < 0) {
    a += b;
  }
  return a;
}
int main() {
  long long n, t, i, j, k, M, f, temp, ans;
  cin >> n >> k >> M;
  for (i = 0; i < 2000; i++) {
    for (j = 0; j < 200; j++) {
      dp[i][j] = 0;
      dp1[i][j] = 0;
    }
  }
  ten[0] = 1;
  tenM[0] = 1;
  for (i = 1; i <= n; i++) {
    ten[i] = 10 * ten[i - 1];
    ten[i] %= k;
    tenM[i] = 10 * tenM[i - 1];
    tenM[i] %= M;
  }
  if (n == 1) {
    ans = 0;
    for (i = 1; i <= 9; i++) {
      if (i % k == 0) ans++;
    }
    ans %= M;
    cout << ans << endl;
    return 0;
  }
  for (i = 0; i < k; i++) {
    dp[1][i] = 0;
  }
  for (i = 0; i <= 9; i++) {
    dp[1][i % k]++;
    dp[1][i % k] %= M;
  }
  ans = 0;
  for (i = 1; i <= n; i++) {
    if (i == n) {
      ans += (dp[i][0] - 1);
      ans = domod(ans, M);
    } else {
      ans += (9 * tenM[n - i - 1] * (dp[i][0] - 1));
      ans = domod(ans, M);
    }
    dp[i][0] = 1;
    for (j = 0; j < k; j++) {
      for (f = 0; f <= 9; f++) {
        temp = ten[i] * f + j;
        temp = domod(temp, k);
        dp[i + 1][temp] += dp[i][j];
        dp[i + 1][temp] = domod(dp[i + 1][temp], M);
      }
    }
  }
  cout << ans << endl;
}
