#include <bits/stdc++.h>
using namespace std;
unsigned long long n, m, d[1011][111], md;
long long q[1001], g[1001];
int main() {
  cin >> n >> m >> md;
  d[0][0] = 1;
  q[1] = 1;
  g[0] = 1;
  g[1] = 9;
  for (int k = 2; k <= n; ++k) g[k] = (g[k - 1] * 10 * 1ll) % md;
  for (int k = 2; k <= n; ++k) q[k] = (q[k - 1] * 10 * 1ll) % m;
  long long ans = 0;
  for (int k = 1; k <= n; ++k) {
    for (int i = 0; i < m; ++i) {
      for (int l = 0; l <= 9; ++l) {
        if (l > 0 && (i + l * q[k] * 1ll) % m == 0) {
          ans = (ans + d[k - 1][i] * 1ll * g[n - k]) % md;
        } else {
          d[k][(i + l * q[k]) % m] =
              (d[k][(i + l * 1ll * q[k]) % m] + d[k - 1][i]) % md;
        }
      }
    }
  }
  cout << ans;
  return 0;
}
