#include<stdio.h>
int main()
{
int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int i,m,d,k,n,p;
scanf(“%d %d”,&m,&d);
k=7-d+1;
i=m-1;
n=a[i]-k;
p=n/7;
if(p*7!=n)
p++;
printf(“%d”,p+1);

}