#include <bits/stdc++.h>
using namespace std;
mt19937_64 mt(time(0));
const int MAXN = 1234;
int mod;
int dp[MAXN][MAXN][2];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(10);
  cout << fixed;
  int n, k;
  cin >> n >> k >> mod;
  dp[0][0][0] = 1;
  long long base = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < k; j++) {
      for (int u = 0; u < 10; u++) {
        if (i == n && u == 0) continue;
        int tmp = (base * u % k + j) % k;
        dp[i][tmp][1] = (dp[i][tmp][1] + dp[i - 1][j][1]) % mod;
        if (tmp == 0 && u != 0) {
          dp[i][tmp][1] = (dp[i][tmp][1] + dp[i - 1][j][0]) % mod;
        } else {
          dp[i][tmp][0] = (dp[i][tmp][0] + dp[i - 1][j][0]) % mod;
        }
      }
    }
    base = base * 10 % k;
  }
  long long ret = 0;
  for (int i = 0; i < k; i++) {
    ret = (ret + dp[n][i][1]) % mod;
  }
  cout << ret << '\n';
  return 0;
}
