#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool read(T &n) {
  T x = 0, tmp = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-' && c != EOF) c = getchar();
  if (c == EOF) return false;
  if (c == '-') c = getchar(), tmp = -1;
  while (c >= '0' && c <= '9') x *= 10, x += (c - '0'), c = getchar();
  n = x * tmp;
  return true;
}
template <class T>
inline void write(T n) {
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  int len = 0, data[20];
  while (n) {
    data[len++] = n % 10;
    n /= 10;
  }
  if (!len) data[len++] = 0;
  while (len--) putchar(data[len] + 48);
}
long long dp[1010][110][2];
long long ten[1010];
int main() {
  long long n, k, m;
  while (read(n) && read(k) && read(m)) {
    ten[0] = 1 % m;
    ;
    for (int i = 1; i <= n; i++) {
      ten[i] = (ten[i - 1] * 10) % k;
    }
    memset(dp, 0, sizeof(dp));
    dp[0][0][0] = 1;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < k; j++) {
        for (int _ = 0; _ <= 9; _++) {
          if (i == n - 1 && _ == 0) continue;
          long long now = (_ * ten[i] + j) % k;
          if (now == 0 && _) {
            dp[i + 1][now][1] = (dp[i + 1][now][1] + dp[i][j][0]) % m;
          } else
            dp[i + 1][now][0] = (dp[i + 1][now][0] + dp[i][j][0]) % m;
          dp[i + 1][now][1] = (dp[i + 1][now][1] + dp[i][j][1]) % m;
        }
      }
    }
    long long ans = 0;
    for (int i = 0; i < k; i++) {
      ans += dp[n][i][1];
    }
    write(ans % m);
    putchar('\n');
  }
}
