// Задача "Награды"
// Шестая Интернет-олимпиада сезона 2009-2010, усложненный уровень
// Автор задачи: Рустам Ганеев, ganeev@rain.ifmo.ru
// Автор решения: Антон Ахи, akhi@rain.ifmo.ru

import java.io.*;
import java.util.*;
import java.math.*;

public class grants_aa_sqr {

	public static void main(String[] args) throws Throwable {
		new grants_aa_sqr().run();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;
	Random rand = new Random(this.hashCode());

	void run() throws Throwable {
		Locale.setDefault(Locale.US);
		br = new BufferedReader(new FileReader(FNAME + ".in"));
		out = new PrintWriter(FNAME + ".out");
		solve();
		out.close();
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	void myAssert(boolean u, String message) {
		if (!u) {
			throw new Error("Assertion failed!!! " + message);
		}
	}

	int inBounds(int x, int l, int r, String name) {
		myAssert(l <= x && x <= r, name + " not in bounds: " + x + " not in ["
				+ l + ".." + r + "]");
		return x;
	}

	String FNAME = "grants";

	private void solve() throws IOException {
		int n = inBounds(nextInt(), 1, 100000, "n");
		int k = inBounds(nextInt(), 1, n, "k");
		long m = inBounds(nextInt(), 1, 1000000000, "m");
		long[][] a = new long[n + 2][k + 1];
		a[0][0] = 1 % m;
		for (int i = 0; i + 1 < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				a[i + 1][j] = (a[i + 1][j] + a[i][j]) % m;
				if (i + 2 < a.length && j + 1 < a[i].length) {
					a[i + 2][j + 1] = (a[i + 2][j + 1] + a[i][j]) % m;
				}
			}
		}
		out.println(a[n + 1][k]);
	}

}
