#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll m;
ll mult(ll a, ll b) { return (a * 1LL * b) % m; }
ll add(ll a, ll b) { return (a + b + m) % m; }
ll dp[1001][101];
int main() {
  ll n, k;
  cin >> n >> k >> m;
  ll tp[n + 1], pt[n + 1];
  tp[0] = 1;
  pt[0] = 1;
  for (ll i = 1; i < n + 1; i++) {
    tp[i] = (tp[i - 1] * 10) % k;
    pt[i] = (pt[i - 1] * 10LL) % m;
  }
  ll ans = 0;
  for (ll i = 0; i < n; i++) {
    for (ll j = 1; j < k; j++) {
      for (ll d = 0; d < 10; d++) {
        ll rem = (j + tp[i] * d) % k;
        dp[i + 1][rem] = add(dp[i + 1][rem], dp[i][j]);
      }
    }
    ans = add(ans, mult(dp[i][0], pt[n - i - 1] * 9));
    for (ll d = 1; d <= 9; d++) {
      dp[i + 1][(tp[i] * d) % k] = add(dp[i + 1][(tp[i] * d) % k], 1);
    }
  }
  ans = add(ans, dp[n][0]);
  cout << ans << "\n";
}
