/* Problem name : A - i Scream 
Time Limit: 2 sec / Memory Limit: 1024 MB

Score : 100 points

Problem Statement
In Japan, there are four major categories of ice cream type products:

an ice cream type product with at least 15 percent milk solids and at least 8 percent milk fat is called an ice cream;
an ice cream type product with at least 10 percent milk solids and at least 3 percent milk fat that is not an ice cream is called an ice milk;
an ice cream type product with at least 3 percent milk solids that is not an ice cream or an ice milk is called a lacto ice;
an ice cream type product that is not an ice cream, an ice milk, or a lacto ice is called a flavored ice.
Here, milk solids consists of milk fat and milk solids-not-fat.

AtCoder's famous product Snuke Ice contains A percent milk solids-not-fat and B percent milk fat.

Which of the categories above does Snuke Ice fall into?

Print your answer as an integer according to the Output section.


Constraints
0≤A≤100
0≤B≤100
A+B≤100
A and B are integers.
*/
# include <cstdio>
using namespace std;
int a,b;
int main()
{
	scanf("%d %d",&a,&b);
	a += b;
	if (a >= 15 && b >= 8) printf("1");
	else if (a >= 10 && b >= 3) printf("2");
	else if (a >= 3) printf("3");
	else printf("4");
	return 0;
}
#include <bits/stdc++.h>
          
#define fi first
#define se second
#define pp pop_back
#define ll long long
#define pb push_back
#define ld long double
#define debug cout << "OK\n";
#define all(x) x.begin(), x.end() 
 
using namespace std;
 
const int N = 5e5 + 200;
const int mod = 1e9 + 7;
const int mod2 = 998244353;
 
void usaco(string filename) {
  	freopen((filename + ".in").c_str(), "r", stdin);
	freopen((filename + ".out").c_str(), "w", stdout);
}
void data()
{
	#ifdef NURS
        freopen("main.in", "r", stdin);
        freopen("main.out", "w", stdout);
    #endif	
}

main() 
{
	data();      
	int a, b;
	cin >> a >> b;
	cout << max(0, a * 2 + 100 - b);	
}
    
/*
test
5
1 2 3 2 1
*/