#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cassert>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;

int n, k, m;

Int dp[165][165][165];

bool between(int a, int b, int c){
    return a < b && b < c;
}

int main(){
    cin >> n >> k >> m;
    if(k % 2 == 0){
        vector<Int> dp(n+1, 0);
        dp[0] = 1;
        for(int i = 1;i <= n;i++){
            for(int j = max(0, i - k/2-1);j < i;j++){
                dp[i] += dp[j];
                dp[i] %= m;
            }
        }
        cout << dp[n/2 + 1] * dp[n-n/2 + 1] % m << endl;
    }
    else{
        int goal = n+3;
        n+=10;
        dp[0][2][1] = 1;
        for(int a = 0;a <= n;a++){
            for(int b = a+2;b <= n;b+=2){
                for(int c = !(a%2);c < b;c+=2){
                    for(int d = c+2;d <= n;d+=2){
                        if(d-2 > c && between(a, d-2-k, b) && between(a, d-2+k, b))break;
                        if(d-2 > c && b-2 > a&& between(a, d-2-k, b) && between(c, b-2-k ,d))break;
                        
                        if(b > d)(dp[a][b][d] += dp[a][b][c]) %= m;
                        else (dp[c][d][b] += dp[a][b][c])%= m;
                    }
                }
            }
        }
        cout << dp[goal][goal+2][goal+1] << endl;
    }
    
    return 0;
}