#include <bits/stdc++.h>
using namespace std;
class test_data_generation {
  int max_n, max_a, q, fft_size, *bit_reversal, *f[2], test_cases;
  class complex_t : public complex<double>{
    public : complex_t(double r = 0, double i = 0){real(r);
  imag(i);
} int set(double r = 0, double i = 0) {
  real(r);
  imag(i);
  return 1;
}
complex_t &operator=(const complex<double> &z) {
  real(z.real());
  imag(z.imag());
  return *this;
}
}
*root, *d[3];
complex_t *new_fft_block() { return new complex_t[fft_size]; }
void fft_0(complex_t *a) {
  for (int i = 0; i < fft_size; ++i) {
    int j = bit_reversal[i];
    if (i < j) swap(a[i], a[j]);
  }
  complex_t e;
  for (int k = 1, l = 2; k < fft_size; k = l, l <<= 1)
    for (int s = 0; s < fft_size; s += l)
      for (int i = 0, j = s, m = k, n = j + k; i < k; ++i, ++j, ++m, ++n)
        e = root[m] * a[n], a[n] = a[j] - e, a[j] += e;
}
void fft_1(complex_t *a) {
  reverse(a + 1, a + fft_size);
  fft_0(a);
}
void update(int &f1, complex_t &d1, int f2, long long w) {
  int u = ((long long)(d1.real() / fft_size + 0.5) + f1) % q;
  u += q, u -= w * f2 % q, f1 = u % q;
}
void solve(int k) {
  if (k == 0) {
    f[0][0] = 1;
    return;
  }
  int l = k / 2;
  solve(l);
  for (int i = max_n + 1; i < fft_size; ++i)
    d[0][i].set(), d[1][i].set(), d[2][i].set();
  int b = l & 1, b1 = b ^ 0, b2 = b ^ 1;
  for (int i = 0; i <= max_n; ++i)
    d[0][i].set(f[0][i] + f[1][i]), d[1][i].set(f[b1][i]),
        d[2][i].set(f[b2][i]);
  fft_0(d[0]);
  fft_0(d[1]);
  fft_0(d[2]);
  for (int i = 0; i < fft_size; ++i) d[1][i] *= d[0][i], d[2][i] *= d[0][i];
  fft_1(d[1]);
  fft_1(d[2]);
  for (int i = max_n; i >= 0; --i) {
    long long w = (long long)(f[0][i] + f[1][i]) % q;
    update(f[0][i], d[1][i], f[b1][0], w);
    update(f[1][i], d[2][i], f[b2][0], w);
  }
  if (k & 1)
    for (int i = max_n, j = i - 1; i > 0; --i, --j)
      f[1][i] += f[0][j] + f[1][j], f[1][i] %= q;
  for (int i = 1; i <= max_n; i += 2) test_cases += f[1][i], test_cases %= q;
}

public:
test_data_generation() : fft_size(1), test_cases(0) {
  cin >> max_n >> max_a >> q;
  int p = 2 * max_n + 1, tl = 0;
  while (fft_size < p) fft_size <<= 1, ++tl;
  p = max_n + 1, bit_reversal = new int[fft_size], root = new_fft_block();
  d[0] = new_fft_block(), d[1] = new_fft_block(), d[2] = new_fft_block();
  for (int j = 0; j < 2; ++j) {
    f[j] = new int[p];
    for (int i = 0; i <= max_n; ++i) f[j][i] = 0;
  }
  for (int i = 0; i < fft_size; ++i) bit_reversal[i] = 0;
  for (int i = 1, l, r; i < fft_size; bit_reversal[i++] = l | r)
    l = bit_reversal[i >> 1] >> 1, r = (i & 1) << (tl - 1);
  int b_size = fft_size >> 1;
  double theta, delta = 2 * acos(-1.0) / fft_size;
  for (int i = 0, j = b_size; i < b_size; ++i, ++j)
    theta = delta * i, root[j].set(cos(theta), sin(theta));
  for (int i = b_size - 1, j = i << 1; i > 0; --i, --j, --j) root[i] = root[j];
}
void solve() { solve(max_a / 2); }
void output_solution() { cout << test_cases; }
}
;
int main() {
  test_data_generation problem;
  problem.solve();
  problem.output_solution();
}
