#include <bits/stdc++.h>
using namespace std;
long long int dp[1024][128];
long long int mods[128];
long long int tots[128];
long long int p10[1024];
int main() {
  int N, K, MOD;
  cin >> N >> K >> MOD;
  p10[0] = 1;
  for (int i = 1; i <= N; i++) p10[i] = (p10[i - 1] * 10) % MOD;
  for (int i = 0; i < 10; i++) mods[i] = i % K;
  for (int i = 1; i <= 9; i++) dp[1][mods[i]] = (dp[1][mods[i]] + 1) % MOD;
  for (int i = 1; i < N; i++) {
    for (int i = 0; i < 10; i++) mods[i] = (mods[i] * 10) % K;
    for (int j = 1; j <= 9; j++)
      dp[i + 1][mods[j]] = (dp[i + 1][mods[j]] + 1) % MOD;
    for (int j = 0; j < K; j++) tots[j] = (tots[j] + dp[i][j]) % MOD;
    for (int j = 1; j < K; j++)
      for (int k = 1; k < 10; k++)
        dp[i + 1][(mods[k] + j) % K] =
            (dp[i + 1][(mods[k] + j) % K] + tots[j]) % MOD;
  }
  long long int total = 0;
  for (int i = 1; i < N; i++)
    total = (total + ((dp[i][0] * p10[N - i - 1]) % MOD) * 9) % MOD;
  total = (total + dp[N][0]) % MOD;
  cout << total << endl;
  return 0;
}
