#include <bits/stdc++.h>
using namespace std;
     
int main() {
  int A, B, C, D;
  cin >> A >> B;
  C = A + B;
  if(C >= 15 && B >= 8){
    D = 1;
  }
  else if(C >= 10 && B >= 3){
    D = 2;
  }
  else if(C >= 3){
    D = 3;
  }
  else{
    D = 4;
  }
  cout << D << endl;
}
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

using namespace std;
#define  fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define  int       long long
#define  ll        long long
#define  mod       1000000007
#define  N         10000002
#define  all(v)    v.begin(),v.end()
#define  maxv(a)   *max_element(all(a))
#define  minv(a)   *min_element(all(a))
#define  sumv(a)    accumulate(all(a),0)
#define rep(i,a,n)  for (ll i=a;i<n;i++)

bool prime[N];

//check prime
bool isPrime(ll n)
{
	if(n<=1)return false;
	for(ll i=2;i*i<=n;i++)
	{
		if(n%i==0)return false;
	}
    return true;
}
//gcd
ll gcd(ll x,ll y)
{
	if(x==0)return y;
	else return gcd(y%x,x);
}
//lcm;
ll lcm(ll x,ll y)
{
	return x*y/gcd(x,y);
}

// sieve of eratosthenes
void sieve(vector<ll> &v)
{
	memset(prime,true,N);
	prime[0]=prime[1]=false;
	for(ll i=2;i*i<N;i++)
	{
		if(prime[i]==true)
		{
			for(ll j=i+i;j<N;j+=i)
			{
				prime[j]=false;
			}
		}
	}
	for(ll i=0;i<N;i++)
	{
		if(prime[i]==true)
		{
			v.push_back(i);
		}
	}
}

//count sum & divisor

ll countDivisor(vector<ll> &v,ll n)
{
	
	for(ll i=1;i*i<=n;i++)
	{
		if(i*i==n)
		{
			v.push_back(i);
		}
		else if(n%i==0)
		{
			v.push_back(i);
			v.push_back(n/i);
		}
	}
}

//primeFactorization

ll primeFactorization(vector<ll> &v,ll n)
{
	while(n%2==0)
	{
		v.push_back(2);
		n/=2;
	}
	for(ll i=3;i*i<=n;i=i+2)  
    {  
        while(n%i==0)  
        {  
			v.push_back(i); 
            n = n/i;  
        }  
    } 
	if(n>2)
    {
    	v.push_back(n);	
	}
}

//Palindrome check string
bool isPalindrome(string s)
{
	int l=0;
	int h=s.size()-1;
	while(l<h)
	{
		if(s[l++]!=s[h--])
		{
			return false;
		}
	}
	return true;
	
}
//	getline(cin,s);
//string to int 
//x=s[i]-48;
//x=s[i]-'0'
//transform(s.begin(), s.end(), s.begin(), ::tolower); 

ll sumofDigit(ll n)
{
	ll sum=0;
	while(n!=0)
	{
		sum+=n%10;
		n/=10;
	}
	return sum;
}
//calculate a^b
ll fastPower(ll a,ll b)
{
	if(b==0)return 1;
	else return a*fastPower(a,b-1);
}
//calculate (x^p)%m
ll fastpowerMOD(ll x,ll p,ll m)
{
	if (p == 1) return x;
	if (p % 2 == 0)
		return 	fastpowerMOD((x%m)*(x%m), p / 2 , m) % m;
	else
		return ((fastpowerMOD((x%m)*(x%m), p / 2 , m) % m) *(x%m)) % m;
}
//vector<pair<string,int> >v
bool sortbysec(const pair<string,int> &a,const pair<string,int> &b) 
{ 
    return (a.second < b.second); 
} 
//vector<pair<int,int> >v
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
} 


//cout << fixed << setprecision(9);
void solve()
{
	int n,x;
	cin>>n>>x;
	int a[n];
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	bool f=true;
	for(int i=0;i<n;i++){
		if(a[i]!=x){
			cout<<a[i]<<" ";
			bool f=false;
		}
	}
	if(f)cout<<" "<<endl;
	
	
}

signed main()
{
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
}
