#include<iostream>
using namespace std;
long long n,k,cnt;
int main() {
cin>>n>>k;
for(long long i=2;i<=n-1;i++){
for(long long j=2;j<=6;j++){
long long F=i*7+j-7;
if((F*9)%11==k)cnt++;
}
}
cout<<cnt<<endl;
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmxvbmcgbG9uZyBuLGssY250OwppbnQgbWFpbigpIHsKCWNpbj4+bj4+azsKCWZvcihsb25nIGxvbmcgaT0yO2k8PW4tMTtpKyspewoJCWZvcihsb25nIGxvbmcgaj0yO2o8PTY7aisrKXsKCQkJbG9uZyBsb25nIEY9aSo3K2otNzsKCQkJaWYoKEYqOSklMTE9PWspY250Kys7CgkJfQoJfQoJY291dDw8Y250PDxlbmRsOwoJcmV0dXJuIDA7Cn0=