#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
const int M = 110;
long long dp[N][M][2], n, m, k, cnt[N], rest[10][N];
void init() {
  cnt[0] = 1;
  for (int i = 1; i <= n; ++i) {
    cnt[i] = cnt[i - 1] * 10 % m;
  }
  for (int j = 1; j <= n; ++j) {
    for (int i = 1; i < 10; ++i) {
      if (j == 1)
        rest[i][j] = i % k;
      else
        rest[i][j] = (10 % k * rest[i][j - 1]) % k;
    }
  }
  memset(dp, 0, sizeof dp);
  for (int i = 0; i < 10; ++i) dp[1][i % k][!i]++;
}
void Run() {
  long long ans = 0;
  if (n == 1) {
    for (int i = 1; i < 10; ++i)
      if (i % k == 0) ans++, ans %= m;
  } else {
    for (int i = 1; i <= n; ++i) {
      for (int j = 0; j < k; ++j) {
        for (int y = 0; y < 2; ++y) {
          if (!y && !j) {
            if (i < n)
              ans = (ans + 9 * cnt[n - i - 1] % m * dp[i][j][y]) % m;
            else
              ans += dp[i][j][y], ans %= m;
          } else {
            for (int z = 0; z < 10; ++z) {
              int i1 = i + 1, j1 = (rest[z][i1] + j) % k;
              dp[i1][j1][!z] += dp[i][j][y], dp[i1][j1][!z] %= m;
            }
          }
        }
      }
    }
  }
  cout << ans << endl;
}
int main() {
  while (cin >> n >> k >> m) init(), Run();
}
