#include <bits/stdc++.h>
using namespace std;
long long f[2][150];
int main() {
  int n, K, m;
  while (scanf("%d%d%d", &n, &K, &m) != EOF) {
    memset(f, 0, sizeof(f));
    f[0][0] = 1;
    int pre = 1, now = 0;
    long long ten = 1;
    for (int i = 1; i <= n; i++) {
      swap(pre, now);
      memset(f[now], 0, sizeof(f[now]));
      if (i > 1) f[now][0] += (f[pre][0] - 1) * 10 % m;
      for (int k = 0; k < 10; k++) f[now][ten * k % K]++;
      for (int j = 1; j < K; j++) {
        for (int k = 0; k < 10; k++) {
          f[now][(j + ten * k) % K] += f[pre][j];
          f[now][(j + ten * k) % K] %= m;
        }
      }
      ten = ten * 10 % K;
    }
    printf("%I64d\n", (m + f[now][0] - f[pre][0]) % m);
  }
}
