#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k, m;
  cin >> n >> k >> m;
  vector<vector<int>> dp(n, vector<int>(k, 0));
  ll ans = 0;
  vector<ll> pw(n + 1, 1);
  vector<ll> pw2(n + 1, 1);
  for (int i = 1; i <= n; i++) {
    pw[i] = (pw[i - 1] * 10) % k;
    pw2[i] = (pw2[i - 1] * 10) % m;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int cur = 1; cur <= 9; cur++) {
      int nxt = (cur * pw[n - i - 1]) % k;
      dp[i][nxt] += 1;
      if (dp[i][nxt] >= m) dp[i][nxt] -= m;
      if (i != n - 1) {
        for (int last = 1; last < k; last++) {
          int nxt = (last + cur * pw[n - i - 1]) % k;
          dp[i][nxt] += dp[i + 1][last];
          if (dp[i][nxt] >= m) dp[i][nxt] -= m;
        }
      }
    }
    ll left = 1;
    if (i != 0) left = (9 * pw2[i - 1]) % m;
    ans += (left * dp[i][0]) % m;
    if (ans >= m) ans -= m;
    if (i != n - 1) {
      for (int last = 1; last < k; last++) {
        dp[i][last] += dp[i + 1][last];
        if (dp[i][last] >= m) dp[i][last] -= m;
      }
    }
  }
  cout << ans;
  return 0;
}
