#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct node
{
   long long  int bl,wh;
}c[101];
int main()
{
  long long  int a,b,d,i,j,s=0;
   scanf("%lld %lld",&a,&b);
   memset(c,0,sizeof(c));
   for(i=1;i<=b;i++)
   {
       if(i%2==0) {c[i].bl=0;c[i].wh=1;}
       else {c[i].wh=0;c[i].bl=1;}
   }
  c[b].bl++;
   for(i=b+1;i<=a;i++)
   {
       c[i].bl=c[i-1].wh+c[i-b].wh;
       c[i].wh=c[i-1].bl;
   }
   for(i=1;i<=a;i++)
   {
       s=s+c[i].bl;
   }

   printf("%lld\n",s);
    return 0;
}

