#include <bits/stdc++.h>
using namespace std;
int n, k, mod, m[1010], dp[1010][110][2][2];
int solve(int idx, int curm, int z, int found) {
  int i, j, d, cur, end;
  long long ans = 0;
  if (idx == 0) {
    found = found || (curm == 0);
    return dp[idx][curm][z][found] = found;
  }
  if (dp[idx][curm][z][found] == -1) {
    end = 0;
    if (idx == 1) end = 1;
    for (d = 9; d >= end; d--) {
      if (d == 0) {
        if (z == 1) {
          cur = curm;
          ans = (ans + solve(idx - 1, cur, 1, found)) % mod;
        } else {
          cur = curm;
          ans = (ans + solve(idx - 1, cur, 0, found | (cur == 0))) % mod;
        }
      } else {
        cur = (((long long)d * m[idx]) % k + curm) % k;
        ans = (ans + solve(idx - 1, cur, 0, found | (cur == 0))) % mod;
      }
    }
    dp[idx][curm][z][found] = ans;
  }
  return dp[idx][curm][z][found];
}
int main() {
  int i, j, ans;
  scanf("%d%d%d", &n, &k, &j);
  mod = j;
  memset(dp, -1, sizeof(dp));
  m[n] = 1;
  for (i = n - 1; i >= 1; i--) m[i] = (10 * m[i + 1]) % k;
  printf("%d\n", solve(n, 0, 1, 0));
  return 0;
}
