#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  int NumberOfX(int n, int k, int m) {
    if (m == 1) {
      return 0;
    }
    if (n == 1) {
      int ans = 0;
      for (int i = 1; i <= 9; i++)
        if (i % k == 0) {
          ans++;
        }
      ans %= m;
      return ans;
    }
    int *free_digit = (int *)malloc((n + 1) * sizeof(int));
    free_digit[0] = 1;
    free_digit[1] = 9 % m;
    for (int i = 2; i <= n; i++) {
      long long temp =
          (long long)free_digit[i - 1] * (long long)10 % (long long)m;
      free_digit[i] = temp;
    }
    int *last = (int *)malloc(k * sizeof(int));
    int *current = (int *)malloc(k * sizeof(int));
    memset(current, 0, k * sizeof(int));
    int base = 1, ans = 0;
    current[0] = 1;
    for (int i = 1; i <= n; i++) {
      int *temp = last;
      last = current;
      current = temp;
      memset(current, 0, k * sizeof(int));
      for (int j = 0; j < k; j++)
        for (int digit = (i == n ? 1 : 0); digit <= 9; digit++) {
          int temp = (digit * base + j) % k;
          current[temp] += last[j];
          if (current[temp] >= m) {
            current[temp] -= m;
          }
        }
      ans = ans + (int)(((long long)(current[0] - (i == n ? 0 : 1)) *
                         (long long)free_digit[n - i]) %
                        (long long)m);
      if (ans >= m) {
        ans -= m;
      }
      current[0] = 1;
      base = base * 10 % k;
    }
    free(last);
    free(current);
    ans %= m;
    if (ans < 0) {
      ans += m;
    }
    return ans;
  }
};
int main() {
  int n, k, m;
  scanf("%d%d%d", &n, &k, &m);
  Solution aa;
  printf("%d\n", aa.NumberOfX(n, k, m));
  return 0;
}
