#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 9;
const int N = (int)3e5 + 4;
const int M = 501;
int dp[2 * M][100];
int h[2 * M], p[2 * M];
int main() {
  int n, k, m;
  cin >> n >> k >> m;
  int ans = 0;
  h[1] = 9;
  h[0] = 1;
  p[0] = 1;
  for (int i = 1; i <= n; ++i) {
    h[i + 1] = ((long long)h[i] * 10) % m;
    p[i] = (p[i - 1] * 10) % k;
  }
  for (int i = 1; i <= n; ++i) {
    for (int t = 1; t < 10; ++t) {
      int r = (t * p[i - 1]) % k;
      if (r != 0) {
        dp[i][r]++;
      } else {
        ans += h[n - i];
        ans %= m;
      }
    }
  }
  for (int i = 1; i < n; ++i) {
    for (int j = 1; j < k; ++j) {
      for (int t = 0; t < 10; ++t) {
        int r = (j + t * p[i]) % k;
        if (r == 0) {
          ans += ((long long)dp[i][j] * h[n - i - 1]) % m;
          ans %= m;
        } else {
          dp[i + 1][r] += dp[i][j];
          dp[i + 1][r] %= m;
        }
      }
    }
    dp[i + 1][0] = 1;
  }
  cout << ans;
  return 0;
}
