#include <bits/stdc++.h>
using namespace std;
bool debug;
const int inf = 1e9 + 5;
const int nax = 1e6 + 5;
int dp[1005][105];
int pot[1005];
int main(int argc, char* argv[]) {
  debug = argc > 1;
  int n, k, mod;
  scanf("%d%d%d", &n, &k, &mod);
  if (mod == 1) {
    puts("0");
    return 0;
  }
  dp[0][0] = 2 % mod;
  pot[0] = 1;
  for (int i = (1); i <= ((1004)); ++i) pot[i] = (pot[i - 1] * 10) % k;
  for (int i = (0); i <= ((n)-1); ++i)
    for (int r = (0); r <= ((k)-1); ++r)
      for (int d = (0); d <= ((10) - 1); ++d)
        if (d > 0 || i < n - 1) {
          if (debug)
            printf("%d %d  ->  %d %d\n", i, r, i + 1, (r + pot[i] * d) % k);
          if (r == 0)
            dp[i + 1][(r + pot[i] * d) % k] =
                (dp[i + 1][(r + pot[i] * d) % k] + 1) % mod;
          else
            dp[i + 1][(r + pot[i] * d) % k] =
                (dp[i + 1][(r + pot[i] * d) % k] + dp[i][r]) % mod;
          if (debug) printf("%d\n", dp[i + 1][(r + pot[i] * d) % k]);
        }
  pot[0] = 1;
  pot[1] = 9;
  for (int i = (2); i <= (1004); ++i)
    pot[i] = ((long long)pot[i - 1] * 10LL) % (long long)mod;
  long long res = 0;
  for (int i = (1); i <= ((n)); ++i)
    res = (res + (long long)((long long)dp[i][0] + ((i == n) ? 0 : (mod - 1))) *
                     (long long)pot[n - i]) %
          (long long)mod;
  printf("%lld\n", res);
  return 0;
}
