#include <bits/stdc++.h>
using namespace std;
template <typename A>
string to_string(A* ptr) {
  stringstream ss;
  ss << "0x" << std::setw(16) << std::setfill('0') << std::hex
     << (uint64_t)(uintptr_t)ptr;
  return ss.str();
}
string to_string(char c) { return ((string) "'" + c) + "'"; }
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
int n, k, m;
void add(int& A, int B) {
  A += B;
  if (A >= m) A -= m;
}
const int MAXN = 1009;
const int MAXK = 109;
int dp[MAXN][MAXK][2][2];
long long solve() {
  add(dp[0][0][0][0], 1);
  for (int cnt_digits = 0, pow10 = 1; cnt_digits < n;
       cnt_digits++, pow10 = (10 * pow10) % k) {
    for (int rem_x = 0; rem_x < k; rem_x++) {
      for (int had_nonzero_y = 0; had_nonzero_y <= 1; had_nonzero_y++) {
        for (int x_is_nonzero = 0; x_is_nonzero <= 1; x_is_nonzero++) {
          if (dp[cnt_digits][rem_x][had_nonzero_y][x_is_nonzero] == 0) continue;
          for (int lead_digit = 0; lead_digit <= 9; lead_digit++) {
            int new_rem_x = (pow10 * lead_digit + rem_x) % k;
            int new_x_is_nonzero = x_is_nonzero || (lead_digit != 0);
            int new_had_nonzero_y =
                had_nonzero_y || (new_rem_x == 0 && new_x_is_nonzero);
            42;
            42;
            add(dp[cnt_digits + 1][new_rem_x][new_had_nonzero_y]
                  [new_x_is_nonzero],
                dp[cnt_digits][rem_x][had_nonzero_y][x_is_nonzero]);
          }
          42;
          42;
        }
      }
    }
  }
  int result = 0;
  int result_sub = 0;
  for (int rem_x = 0; rem_x < k; rem_x++) {
    add(result, dp[n][rem_x][1][1]);
    add(result_sub, dp[n - 1][rem_x][1][1]);
  }
  int answer = (result - result_sub + m) % m;
  return answer;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int TT;
  TT = 1;
  for (int ttt = 0; ttt < TT; ttt++) {
    cin >> n >> k >> m;
    cout << solve() << '\n';
  }
  return 0;
}
