#include <bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define Need_for_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz size()

typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

int a[100001];

int main(){
	int n,m,y=0;
	string s,t;
	cin>>n>>m>>s>>t;
	for(int i=0;i<t.sz;i++){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y++;
				s[y-1]='!';
				t[i]='!';
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			break;
		}
	}
	y=n-1;
	for(int i=m-1;i>=0;i--){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y--;
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define Need_for_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz size()

typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

int a[100001];

int main(){
	int n,m,y=0;
	string s,t;
	cin>>n>>m>>s>>t;
	for(int i=0;i<t.sz;i++){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y++;
			}
		}
		else{
			if(y==i){
				break;
			}
			else{
				cout<<"NO";
				return 0;
			}
		}
		if(y!=i){
			cout<<"NO";
			return 0;
		}
	}
	y=n-1;
	for(int i=m-1;i>=0;i--){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y--;
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define Need_for_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz size()

typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

int a[100001];
int n,m,y=0;
string s,t;

int main(){
	int k=0;
	cin>>n>>m>>s>>t;
	if(s==t){
		cout<<"YES";
		return 0;
	}
	for(int i=0;i<max(n,m);i++){
		if(s[y]!='*'){
			if(s[y]==t[k]){
				y++;
				k++;
				s[y-1]='!';
				t[k-1]='@';
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			break;
		}
	}
	y=n-1;
	k=m-1;
	for(int i=max(n,m)-1;i>=0;i--){
		if(s[y]!='*'){
			if(s[y]==t[k]){
				s[y]='!';
				t[k]='@';
				y--;
				k--;
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define Need_for_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz size()

typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

int a[100001];

int main(){
	int n,m,y=0;
	string s,t;
	cin>>n>>m>>s>>t;
	if(s==t){
		cout<<"YES";
		return 0;
	}
	for(int i=0;i<m;i++){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y++;
				s[y-1]='!';
				t[i]='@';
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			break;
		}
	}
	y=n-1;
	for(int i=m-1;i>=0;i--){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				s[y]='!';
				t[i]='@';
				y--;
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define Need_for_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz size()

typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

int a[100001];

int main(){
	int n,m,y=0;
	string s,t;
	cin>>n>>m>>s>>t;
	for(int i=0;i<m;i++){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y++;
				s[y-1]='!';
				t[i]='@';
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			break;
		}
	}
	y=n-1;
	for(int i=m-1;i>=0;i--){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				s[y]='!';
				t[i]='@';
				y--;
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define Need_for_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz size()

typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

int a[100001];

int main(){
	int n,m,y=0;
	string s,t;
	cin>>n>>m>>s>>t;
	for(int i=0;i<t.sz;i++){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y++;
			}
		}
		else{
			if(y==i){
				break;
			}
			else{
				cout<<"NO";
				return 0;
			}
		}
	}
	y=n-1;
	for(int i=m-1;i>=0;i--){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y--;
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define Need_for_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz size()

typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

int a[100001];

int main(){
	int n,m,y=0;
	string s,t;
	cin>>n>>m>>s>>t;
	for(int i=0;i<t.sz;i++){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y++;
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			if(y==i){
				break;
			}
			else{
				cout<<"NO";
				return 0;
			}
		}
	}
	y=n-1;
	for(int i=m-1;i>=0;i--){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y--;
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define Need_for_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define sz size()

typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;

int a[100001];

int main(){
	int n,m,y=0;
	string s,t;
	cin>>n>>m>>s>>t;
	if(s==t){
		cout<<"YES";
		return 0;
	}
	for(int i=0;i<m;i++){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				y++;
				s[y-1]='!';
				t[i]='@';
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			break;
		}
	}
	y=n-1;
	for(int i=m-1;i>=-1;i--){
		if(s[y]!='*'){
			if(s[y]==t[i]){
				s[y]='!';
				t[i]='@';
				y--;
			}
			else {
				cout<<"NO";
				return 0;
			}
		}
		else{
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m,f=0,d,pb,pa,c=0,v;

	cin>>n>>m;

	string a,b;

	cin>>a>>b;

	if(n>m+1)cout<<"NO";

	else{
	d=m-(n-1);
	pa=0;
		for(int i=0;i<n;i++){
			if(a[i]=='*'){pa=i; break; }
			else if(a[i]!=b[i]){c=1; break;}
		}

		if(c==1)cout<<"NO";

		else{ pb=m;
			for(int i=n-1 , j=m-1; i>pa;i--,j--){
				if(a[i]!=b[j]){c=1; break; }
				pb=j;
			}//cout<<pb<<" "<<pa<<endl;

			if(c==1)cout<<"NO";
			else if(pb-pa==d )  cout<<"YES";
			else cout<<"NO";
		}

	}
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m,f=0,d,p;

	cin>>n>>m;

	string a,b;

	cin>>a>>b;

	if(n>m+1)cout<<"NO";

	else{
	d=m-n;
		for(int i=0,j=0;i<n && j<m;i++,j++){
			p=j;

		    if(a[i]=='*'){ j=j+d;  if(j==m-1)break;
		    				continue ;}
			if(a[i]!=b[j]) {
			f=1; break;
			}

		}

		if(f==1)cout<<"NO";
		else if(f==0 && p!=m-1) cout<<"NO";
		else cout<<"YES";

	}
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m,f=0,d,p;

	cin>>n>>m;

	string a,b;

	cin>>a>>b;

	if(n>m+1)cout<<"NO";

	else{
	d=m-n;
		for(int i=0,j=0;i<n && j<m;i++,j++){
			p=j;

		    if(a[i]=='*'){ j=j+d;  p=j;
		    				 if(j==m-1)break;
		    				continue ;}
			if(a[i]!=b[j]) {
			f=1; break;
			}

		}

		if(f==1)cout<<"NO";
		else if(f==0 && p!=m-1) cout<<"NO";
		else cout<<"YES";

	}
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m,f=0,d;

	cin>>n>>m;

	string a,b;

	cin>>a>>b;

	if(n>m+1)cout<<"NO";

	else{
	d=m-n;
		for(int i=0,j=0;i<n && j<m;i++,j++){

		    if(a[i]=='*'){ j=j+d;
		    				continue ;}
			if(a[i]!=b[j]) {
			f=1; break;
			}
		}

		if(f==1)cout<<"NO";
		else if(f==0 && n-m!=0) cout<<"NO";
		else cout<<"YES";

	}
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m,f=0,d;

	cin>>n>>m;

	string a,b;

	cin>>a>>b;

	if(n>m+1)cout<<"NO";

	else{
	d=m-n;
		for(int i=0,j=0;i<n && j<m;i++,j++){

		    if(a[i]=='*'){ j=j+d;
		    				continue ;}
			if(a[i]!=b[j]) {
			f=1; break;
			}
		}

		if(f==1)cout<<"NO";
		else cout<<"YES";

	}
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m,f=0,d,pb,pa,c=0,v;

	cin>>n>>m;

	string a,b;

	cin>>a>>b;

	if(n>m+1)cout<<"NO";

	else{
	d=m-(n-1);
		for(int i=0;i<n;i++){
			if(a[i]=='*'){pa=i; break; }
			else if(a[i]!=b[i]){c=1; break;}
		}

		if(c==1)cout<<"NO";

		else{ pb=m;
			for(int i=n-1 , j=m-1; i>pa;i--,j--){
				if(a[i]!=b[j]){c=1; break; }
				pb=j;
			}//cout<<pb<<" "<<pa<<endl;

			if(c==1)cout<<"NO";
			else if(pb-pa==d )  cout<<"YES";
			else cout<<"NO";
		}

	}
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m,f=0,d,p,v;

	cin>>n>>m;

	string a,b;

	cin>>a>>b;

	if(n>m+1)cout<<"NO";

	else{
	d=m-n;
		for(int i=0,j=0;i<n && j<m;i++,j++){
			p=j; v=i;

		    if(a[i]=='*'){ j=j+d;  p=j;
		    				 if(j==m-1)break;
		    				continue ;}
			if(a[i]!=b[j]) {
			f=1; break;
			}

		}

		if(f==1)cout<<"NO";
		else if(f==0 && (p!=m-1 ||  v!=n-1)) cout<<"NO";
		else cout<<"YES";

	}
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m,f=0,d,pb,pa,c=0,v;

	cin>>n>>m;

	string a,b;

	cin>>a>>b;

	if(n>m+1)cout<<"NO";

	else{
	d=m-(n-1);
	pa=0;
		for(int i=0;i<n;i++){
			if(a[i]=='*'){f=1; pa=i; break; }
			else if(a[i]!=b[i]){c=1; break;}
		}

		if(c==1)cout<<"NO";
		else if(f==0 ){
			if(a==b)cout<<"YES";
			else cout<<"NO";
		}

		else{ pb=m;
			for(int i=n-1 , j=m-1; i>pa;i--,j--){
				if(a[i]!=b[j]){c=1; break; }
				pb=j;
			}//cout<<pb<<" "<<pa<<endl;

			if(c==1)cout<<"NO";
			else if(pb-pa==d )  cout<<"YES";
			else cout<<"NO";
		}

	}
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m,f=0,d;

	cin>>n>>m;

	string a,b;

	cin>>a>>b;

	if(n>m)cout<<"NO";

	else{
	d=m-n;
		for(int i=0,j=0;i<n && j<m;i++,j++){

		    if(a[i]=='*'){j=j+d; continue ;}
			if(a[i]!=b[j]) {cout<<i<<j<<endl;
			f=1; break;
			}
		}

		if(f==1)cout<<"NO";
		else cout<<"YES";

	}
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,m,f=0,d,pb,pa,c=0,v;

	cin>>n>>m;

	string a,b;

	cin>>a>>b;

	if(n>m+1)cout<<"NO";

	else{
	d=m-(n-1);
		for(int i=0;i<n;i++){
			if(a[i]=='*'){pa=i; break; }
			else if(a[i]!=b[i]){c=1; break;}
		}

		if(c==1)cout<<"NO";

		else{
			for(int i=n-1 , j=m-1; i>pa;i--,j--){
				if(a[i]!=b[j]){c=1; break; }
				pb=j;
			}//cout<<pb<<" "<<pa<<endl;

			if(c==1)cout<<"NO";
			else if(pb-pa==d )  cout<<"YES";
			else cout<<"NO";
		}

	}
}


#include <iostream>
#include<bits/stdc++.h>
typedef long long int lli;
using namespace std;

int main()
{
    lli n,m;cin>>n>>m;lli c=0,i=0;
    string s,t;cin>>s>>t;
    for( i=0;s[i]!='*'&&i<n&&i<m;i++)
    {
        if(s[i]!=t[i]){c++;break;}
    }
    if(c!=0)cout<<"NO";
    else if(i==n&&n==m)cout<<"YES";
    else if(i==n&&n!=m)cout<<"NO";
    else if(i==m&&n-m==1&&s[i]=='*')cout<<"YES";
     else if(i==m&&n-m==1&&s[i]!='*')cout<<"NO";
    else{
    lli j,k;c=0;
   for(j=n-1,k=m-1;s[j]!='*'&&j>=0&&k>=0;j--,k--)
   {
       if(s[j]!=t[k]){c++;break;}
   }
   if(c!=0)cout<<"NO";
   else{
   k+=1;
   i-=1;
  // cout<<i<<" "<<k<<"\n";
   if(k>i)cout<<"YES";
   else cout<<"NO";
   }
    }
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
typedef long long int lli;
using namespace std;

int main()
{
    lli n,m;cin>>n>>m;lli c=0,i=0;
    string s,t;cin>>s>>t;
    if(s==t)cout<<"YES";
    else{
    for( i=0;s[i]!='*'&&i<n&&i<m;i++)
    {
        if(s[i]!=t[i]){c++;break;}
    }
    if(c!=0)cout<<"NO";
    else{
      //  cout<<i<<"\n";
    lli size=n-i-1;
    lli j=m-size;
   // cout<<j<<"\n";
    for(lli k=i+1;k<n;k++)
    {
        if(s[k]!=t[j]){c++;break;}
        j++;
    }
    if(c!=0)cout<<"NO";
    else cout<<"YES";
    }
    }
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
typedef long long int lli;
using namespace std;

int main()
{
    lli n,m;cin>>n>>m;lli c=0,i=0;
    string s,t;cin>>s>>t;
    if(s.find("*")==string::npos)
    {
    if(s==t)cout<<"YES";else cout<<"NO";
    }
    else{
    for( i=0;s[i]!='*'&&i<n&&i<m;i++)
    {
        if(s[i]!=t[i]){c++;break;}
    }
    if(c!=0)cout<<"NO";
    else{
    //  cout<<i<<"\n";
    lli size=n-i-1;
    lli j=m-size;
  // cout<<j<<"\n";
   if(i>j)cout<<"NO";
   else{
    for(lli k=i+1;k<n;k++)
    {
        if(s[k]!=t[j]){c++;break;}
        j++;
    }
    if(c!=0)cout<<"NO";
    else cout<<"YES";
    }
    }
    }
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
typedef long long int lli;
using namespace std;

int main()
{
    lli n,m;cin>>n>>m;lli c=0,i=0;
    string s,t;cin>>s>>t;
    for( i=0;s[i]!='*'&&i<n&&i<m;i++)
    {
        if(s[i]!=t[i]){c++;break;}
    }
    if(c!=0)cout<<"NO";
    else if(i==n&&n==m)cout<<"YES";
    else if(i==n&&n!=m||i==m&&n!=m)cout<<"NO";
    else{
    lli j,k;c=0;
   for(j=n-1,k=m-1;s[j]!='*'&&j>=0&&k>=0;j--,k--)
   {
       if(s[j]!=t[k]){c++;break;}
   }
   if(c!=0)cout<<"NO";
   else{
   k+=1;
   i-=1;
   cout<<i<<" "<<k<<"\n";
   if(k>i)cout<<"YES";
   else cout<<"NO";
   }
    }
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
typedef long long int lli;
using namespace std;

int main()
{
    lli n,m;cin>>n>>m;lli c=0,i=0;
    string s,t;cin>>s>>t;
    if(s==t)cout<<"YES";
    else{
    for( i=0;s[i]!='*'&&i<n&&i<m;i++)
    {
        if(s[i]!=t[i]){c++;break;}
    }
    if(c!=0)cout<<"NO";
    else{
    lli j,k;c=0;
   for(j=n-1,k=m-1;s[j]!='*'&&j>=0&&k>=0;j--,k--)
   {
       if(s[j]!=t[k]){c++;break;}
   }
   if(c!=0)cout<<"NO";
   else{
   k+=1;
   i-=1;
  // cout<<i<<" "<<k<<"\n";
   if(k>i)cout<<"YES";
   else cout<<"NO";
   }
    }
    }
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
typedef long long int lli;
using namespace std;

int main()
{
    lli n,m;cin>>n>>m;lli c=0,i=0;
    string s,t;cin>>s>>t;
    for( i=0;s[i]!='*'&&i<n&&i<m;i++)
    {
        if(s[i]!=t[i]){c++;break;}
    }
    if(c!=0)cout<<"NO";
    else if(i==n&&n==m)cout<<"YES";
    else if(i==n&&n!=m||i==m&&n!=m)cout<<"NO";
    else{
    lli j,k;c=0;
   for(j=n-1,k=m-1;s[j]!='*'&&j>=0&&k>=0;j--,k--)
   {
       if(s[j]!=t[k]){c++;break;}
   }
   if(c!=0)cout<<"NO";
   else{
   k+=1;
   i-=1;
  // cout<<i<<" "<<k<<"\n";
   if(k>i)cout<<"YES";
   else cout<<"NO";
   }
    }
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
typedef long long int lli;
using namespace std;

int main()
{
    lli n,m;cin>>n>>m;lli c=0,i;
    string s,t;cin>>s>>t;
    for( i=0;s[i]!='*'&&i<n;i++)
    {
        if(s[i]!=t[i]){c++;break;}
    }
    if(c!=0)cout<<"NO";
    else{
    lli j,k;c=0;
   for(j=n-1,k=m-1;s[j]!='*'&&j>=0&&k>=0;j--,k--)
   {
       if(s[j]!=t[k]){c++;break;}
   }
   if(c!=0)cout<<"NO";
   else{
   k+=1;
   i-=1;
  // cout<<i<<" "<<k<<"\n";
   if(k>i)cout<<"YES";
   else cout<<"NO";
   }
    }
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
typedef long long int lli;
using namespace std;

int main()
{
    lli n,m;cin>>n>>m;lli c=0,i=0;
    string s,t;cin>>s>>t;
    if(s==t)cout<<"YES";
    else{
    for( i=0;s[i]!='*'&&i<n&&i<m;i++)
    {
        if(s[i]!=t[i]){c++;break;}
    }
    if(c!=0)cout<<"NO";
    else{
    //    cout<<i<<"\n";

    lli size=n-i-1;
    lli j=m-size;
  // cout<<j<<"\n";
   if(i>j)cout<<"NO";
   else{
    for(lli k=i+1;k<n;k++)
    {
        if(s[k]!=t[j]){c++;break;}
        j++;
    }
    if(c!=0)cout<<"NO";
    else cout<<"YES";
    }
    }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int n,m;
string s,t;

template<typename Drake>
void read(Drake &x){
	x=0;char ch=getchar();bool f=1;
	while(!isdigit(ch)){
		if(ch=='-')f^=1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	x*=(2*f-1);
}

template<typename Drake>
void write(Drake x){
	if(x<0){x=-x;putchar('-');}
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

template<typename Drake>
void writeln(Drake x){
	write(x);
	puts("");
}

void init(){
	cin>>n>>m;
	cin>>s>>t;
}

int main(){
	init();
	s='?'+s;
	t='?'+t;
	if(s.find('*')==-1){
		if(s==t)
		puts("YES");
		else puts("NO");
		return 0;
	}
	int pos;
	if(n>m+1){
		puts("NO");
		return 0;
	}
	pos=-1;
	for(register int i=1;i<=n;i++)
	if(s[i]!=t[i]){
		if(s[i]=='*')
		pos=i;
		break;
	}
	if(pos==-1){
		puts("NO");
		return 0;
	}
	pos++;
	for(register int i=pos;i<=n;i++)
	if(s[i]!=t[i-n+m]){
		puts("NO");
		return 0;
	}
	puts("YES");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int n,m;
string s,t;

template<typename Drake>
void read(Drake &x){
	x=0;char ch=getchar();bool f=1;
	while(!isdigit(ch)){
		if(ch=='-')f^=1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	x*=(2*f-1);
}

template<typename Drake>
void write(Drake x){
	if(x<0){x=-x;putchar('-');}
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

template<typename Drake>
void writeln(Drake x){
	write(x);
	puts("");
}

void init(){
	read(n);read(m);
	cin>>s>>t;
}

int main(){
	init();
	s='?'+s;t='?'+t;
	if(s.find('*')==-1){
		if(s==t)
		puts("YES");
		else puts("NO");
		return 0;
	}
	int posi;
	for(register int i=1;i<=n;i++)
	if(s[i]==t[i]){
		continue;
	}
	else if(s[i]=='*'){
		posi=i;
		break;
	}
	else {
		puts("NO");
		return 0;
	}
	posi++;
	for(register int i=posi;i<=n;i++)
	if(s[i]!=t[i-n+m]){
		puts("NO");
		return 0;
	}
	puts("YES");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int n,m;
string s,t;

template<typename Drake>
void read(Drake &x){
	x=0;char ch=getchar();bool f=1;
	while(!isdigit(ch)){
		if(ch=='-')f^=1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	x*=(2*f-1);
}

template<typename Drake>
void write(Drake x){
	if(x<0){x=-x;putchar('-');}
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

template<typename Drake>
void writeln(Drake x){
	write(x);
	puts("");
}

void init(){
	read(n);read(m);
	cin>>s>>t;
}

int main(){
	init();
	int i,j,k;
	j=0;
	for(register int i=0;i<n&&j<m;i++)
	if(s[i]!=t[j]){
		if(s[i]!='*'){
			puts("NO");
			return 0;
		}
		j--;
		break;
	}
	else j++;
	k=m-1;
	for(register int i=n-1;i>=0&&j>=0;i--)
	if(s[i]!=t[k]){
		if(s[i]!='*'){
			puts("NO");
			return 0;
		}
		k--;
		break;
	}
	else k--;
	if(j==m||k==0){
		puts("YES");
		return 0;
	}
	if(j<=k){
		puts("YES");
	}
	else{
		puts("NO");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int n,m;
string s,t;

template<typename Drake>
void read(Drake &x){
	x=0;char ch=getchar();bool f=1;
	while(!isdigit(ch)){
		if(ch=='-')f^=1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	x*=(2*f-1);
}

template<typename Drake>
void write(Drake x){
	if(x<0){x=-x;putchar('-');}
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

template<typename Drake>
void writeln(Drake x){
	write(x);
	puts("");
}

void init(){
	read(n);read(m);
	cin>>s>>t;
}

int main(){
	init();
	s='?'+s;t='?'+t;
	if(s.find('*')==-1){
		if(s==t)
		puts("YES");
		else puts("NO");
		return 0;
	}
	int posi;
	for(register int i=1;i<=n;i++)
	if(s[i]==t[i]){
		continue;
	}
	else if(s[i]=='*'){
		posi=i;
		break;
	}
	else {
		puts("NO");
		return 0;
	}
	posi++;
	for(register int i=posi;i<=n;i++)
	if(s[i]!=t[i-n+m]){
		puts("NO");
		return 0;
	}
	if(n>m+1)
	puts("NO");
	else puts("YES");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int n,m;
string s,t;

template<typename Drake>
void read(Drake &x){
	x=0;char ch=getchar();bool f=1;
	while(!isdigit(ch)){
		if(ch=='-')f^=1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	x*=(2*f-1);
}

template<typename Drake>
void write(Drake x){
	if(x<0){x=-x;putchar('-');}
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

template<typename Drake>
void writeln(Drake x){
	write(x);
	puts("");
}

void init(){
	read(n);read(m);
	cin>>s>>t;
}

int main(){
	init();
	int i,j,k;
	j=0;
	for(register int i=0;i<n&&j<m;i++)
	if(s[i]!=t[j]){
		if(s[i]!='*'){
			puts("NO");
			return 0;
		}
		break;
	}
	else j++;
	k=m-1;
	for(register int i=n-1;i>=0&&j>=0;i--)
	if(s[i]!=t[k]){
		if(s[i]!='*'){
			puts("NO");
			return 0;
		}
		break;
	}
	else k--;
	j--;
	k++;
	if(j<=k){
		puts("YES");
	}
	else{
		puts("NO");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int n,m;
string s,t;

template<typename Drake>
void read(Drake &x){
	x=0;char ch=getchar();bool f=1;
	while(!isdigit(ch)){
		if(ch=='-')f^=1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	x*=(2*f-1);
}

template<typename Drake>
void write(Drake x){
	if(x<0){x=-x;putchar('-');}
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

template<typename Drake>
void writeln(Drake x){
	write(x);
	puts("");
}

void init(){
	read(n);read(m);
	cin>>s>>t;
}

int main(){
	init();
	s='?'+s;t='?'+t;
	if(s.find('*')==-1){
		if(s==t)
		puts("YES");
		else puts("NO");
		return 0;
	}
	int posi;
	for(register int i=1;i<=n;i++)
	if(s[i]==t[i]){
		continue;
	}
	else if(s[i]=='*'){
		posi=i;
		break;
	}
	else {
		puts("NO");
		return 0;
	}
	posi++;
	for(register int i=posi;i<=n;i++)
	if(s[i]!=t[i-n+m]){
		puts("NO");
		return 0;
	}
	if(n>m)
	puts("NO");
	else puts("YES");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int n,m;
string s,t;

template<typename Drake>
void read(Drake &x){
	x=0;char ch=getchar();bool f=1;
	while(!isdigit(ch)){
		if(ch=='-')f^=1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	x*=(2*f-1);
}

template<typename Drake>
void write(Drake x){
	if(x<0){x=-x;putchar('-');}
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

template<typename Drake>
void writeln(Drake x){
	write(x);
	puts("");
}

void init(){
	read(n);read(m);
	cin>>s>>t;
}

int main(){
	init();
	int i,j,j1;
	for(i=0,j=0;i<n&&j<m;){
		if(s[i]==t[j]){
			i++;j++;
		}
		else break;
	}
	if(s[i]!='*'){
		puts("NO");
		return 0;
	}
	for(i=n-1,j1=m-1;j1>=0&&i>=0;){
		if(s[i]==t[j1]){
			i--;j1--;
		}
		else break;
	}
	j--;j1++;
	if(j<=j1){
		puts("YES");
	}
	else{
		puts("NO");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int n,m;
string s,t;

template<typename Drake>
void read(Drake &x){
	x=0;char ch=getchar();bool f=1;
	while(!isdigit(ch)){
		if(ch=='-')f^=1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	x*=(2*f-1);
}

template<typename Drake>
void write(Drake x){
	if(x<0){x=-x;putchar('-');}
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

template<typename Drake>
void writeln(Drake x){
	write(x);
	puts("");
}

void init(){
	read(n);read(m);
	cin>>s>>t;
}

int main(){
	init();
	s='?'+s;t='?'+t;
	if(s.find('*')==-1){
		if(s==t)
		puts("YES");
		else puts("NO");
	}
	int posi;
	for(register int i=1;i<=n;i++)
	if(s[i]==t[i]){
		continue;
	}
	else if(s[i]=='*'){
		posi=i;
		break;
	}
	else {
		puts("NO");
		return 0;
	}
	posi++;
	for(register int i=posi;i<=n;i++)
	if(s[i]!=t[i-n+m]){
		puts("NO");
		return 0;
	}
	puts("YES");
	return 0;
}


#include<stdio.h>
int main(){
	long long n,m;scanf("%lld%lld",&n,&m);
	char s[n],t[m];
	scanf("%s%s",s,t);
	long long i,j,k,pd=1;
//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO2");
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	getchar();
	scanf("%s",s);
getchar();
	scanf("%s",t);
	long long i,j,k,pd=1;
//	getchar();
//for(i=0;i<n;i++){
//	scanf("%c",&s[i]);
//}
//getchar();
//for(i=0;i<m;i++){
//	scanf("%c",&t[i]);
//}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c\n",s[0],s[1],s[2]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
int main(){
	long long n,m;scanf("%lld%lld",&n,&m);
	char s[n],t[m];
	scanf("%s%s",s,t);
	long long i,j,k,pd=1;
//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(s[i]!='*'){
		printf("NO");
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
//	getchar();
//	scanf("%s",s);
//	scanf("%s",t);
	long long i,j,k,pd=1;
	getchar();
for(i=0;i<n;i++){
	scanf("%c",&s[i]);
}
getchar();
for(i=0;i<m;i++){
	scanf("%c",&t[i]);
}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
//	else if(n==1){
//		printf("NO");;
//	}
	else if(s[i]!='*'){
		printf("NO\n");
//		printf("i=%lld\n",i);
//				printf("si=%c\n",s[i]);
//				printf("n=%lld,m=%lld\n",n,m);
//					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
//				printf("s %c %c %c\n",s[0],s[1],s[2]);
//					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	scanf("%s",s);
	scanf("%s",t);
	long long i,j,k,pd=1;
//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO2\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c\n",s[0],s[1],s[2]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	getchar();
	scanf("%s",s);
getchar();
	scanf("%s",t);
	long long i,j,k,pd=1;
//	getchar();
//for(i=0;i<n;i++){
//	scanf("%c",&s[i]);
//}
//getchar();
//for(i=0;i<m;i++){
//	scanf("%c",&t[i]);
//}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	//	printf("%c",s[0]);

	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c %c\n",s[0],s[1],s[2],s[3]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else {
	printf("YES");
//	printf("%c",s[0]);
	}

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	getchar();
	scanf("%s",s);
	scanf("%s",t);
	long long i,j,k,pd=1;

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO2\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c\n",s[0],s[1],s[2]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	getchar();	getchar();
	scanf("%s",s);
getchar();
	scanf("%s",t);
	long long i,j,k,pd=1;
//	getchar();
//for(i=0;i<n;i++){
//	scanf("%c",&s[i]);
//}
//getchar();
//for(i=0;i<m;i++){
//	scanf("%c",&t[i]);
//}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c %c\n",s[0],s[1],s[2],s[3]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	getchar();
	scanf("%s",s);
getchar();
	scanf("%s",t);
	long long i,j,k,pd=1;
//	getchar();
//for(i=0;i<n;i++){
//	scanf("%c",&s[i]);
//}
//getchar();
//for(i=0;i<m;i++){
//	scanf("%c",&t[i]);
//}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
		printf("%c",s[0]);
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c %c\n",s[0],s[1],s[2],s[3]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else {
	printf("YES");
//	printf("%c",s[0]);
	}

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	getchar();
	scanf("%s",s);
getchar();
	scanf("%s",t);
	long long i,j,k,pd=1;
//	getchar();
//for(i=0;i<n;i++){
//	scanf("%c",&s[i]);
//}
//getchar();
//for(i=0;i<m;i++){
//	scanf("%c",&t[i]);
//}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c %c\n",s[0],s[1],s[2],s[3]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else {
	printf("YES");
	printf("%c",s[0]);
	}

	}

	return 0;
}


#include<stdio.h>
int main(){
	long long n,m;scanf("%lld%lld",&n,&m);
	char s[n],t[m];
	scanf("%s%s",s,t);
	long long i,j,k,pd=1;
//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO2\n");
			printf("i=%d\n",i);
				printf("si=%d\n",s[i]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
int main(){
	long long n,m;scanf("%lld%lld",&n,&m);
	char s[n],t[m];
	scanf("%s%s",s,t);
	long i,j,k,pd=1;
//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(s[i]!='*'){
		printf("NO");
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	getchar();getchar();getchar();
	scanf("%s",s);
getchar();
	scanf("%s",t);
	long long i,j,k,pd=1;
//	getchar();
//for(i=0;i<n;i++){
//	scanf("%c",&s[i]);
//}
//getchar();
//for(i=0;i<m;i++){
//	scanf("%c",&t[i]);
//}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c\n",s[0],s[1],s[2]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
//	getchar();
//	scanf("%s",s);
//	scanf("%s",t);
	long long i,j,k,pd=1;
	getchar();
for(i=0;i<n;i++){
	scanf("%c",&s[i]);
}
getchar();
for(i=0;i<m;i++){
	scanf("%c",&t[i]);
}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO2\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c\n",s[0],s[1],s[2]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	//getchar();
	scanf("%s",s);
getchar();
	scanf("%s",t);
	long long i,j,k,pd=1;
//	getchar();
//for(i=0;i<n;i++){
//	scanf("%c",&s[i]);
//}
//getchar();
//for(i=0;i<m;i++){
//	scanf("%c",&t[i]);
//}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c\n",s[0],s[1],s[2]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
//	getchar();
//	scanf("%s",s);
//	scanf("%s",t);
	long long i,j,k,pd=1;
for(i=0;i<n;i++){
	scanf("%c",&s[i]);
}
getchar();
for(i=0;i<m;i++){
	scanf("%c",&t[i]);
}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO2\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c\n",s[0],s[1],s[2]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	getchar();
	scanf("%s",s);
getchar();
	scanf("%s",t);
	long long i,j,k,pd=1;
//	getchar();
//for(i=0;i<n;i++){
//	scanf("%c",&s[i]);
//}
//getchar();
//for(i=0;i<m;i++){
//	scanf("%c",&t[i]);
//}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	//	printf("%c",s[0]);

		printf("NO\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c %c\n",s[0],s[1],s[2],s[3]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c %c\n",s[0],s[1],s[2],s[3]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else {
	printf("YES");
//	printf("%c",s[0]);
	}

	}

	return 0;
}


#include<stdio.h>
int main(){
	long long n,m;scanf("%lld%lld",&n,&m);
	char s[n],t[m];
	scanf("%s%s",s,t);
	long long i,j,k,pd=1;
//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(s[i]!='*'){
		printf("NO2");
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	scanf("%s%s",s,t);
	long long i,j,k,pd=1;
//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO2\n");
		printf("i=%d\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%d,m=%d\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	scanf("%s%s",s,t);
	long long i,j,k,pd=1;
//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO2\n");
		printf("i=%d\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%d,m=%d\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c\n",s[0],s[1],s[2]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	//getchar();
	scanf("%s",s);
getchar();
	scanf("%s",t);
	long long i,j,k,pd=1;
//	getchar();
//for(i=0;i<n;i++){
//	scanf("%c",&s[i]);
//}
//getchar();
//for(i=0;i<m;i++){
//	scanf("%c",&t[i]);
//}

//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
//	printf("%d %d",s[0],t[0]);
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c %c\n",s[0],s[1],s[2],s[3]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
#include<string.h>
int main(){
	long long n,m;scanf("%lld %lld",&n,&m);
	char s[n],t[m];
	scanf("%s%s",s,t);
	long long i,j,k,pd=1;
//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO2\n");
		printf("i=%lld\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%lld,m=%lld\n",n,m);
					printf("sn=%d,tm=%d\n",strlen(s),strlen(t));
				printf("s %c %c %c\n",s[0],s[1],s[2]);
					printf("t %c %c %c\n",t[0],t[1],t[2]);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include<stdio.h>
int main(){
	long long n,m;scanf("%lld%lld",&n,&m);
	char s[n],t[m];
	scanf("%s%s",s,t);
	long long i,j,k,pd=1;
//	for(i=0;i<m;i++){
//
//	}
	i=0;
	while(s[i]==t[i]&&i<n){
		i++;//i=2   i+1=3
	}
	//printf("%d\n",i);
	if(n>m+1){
		printf("NO");
	}

	else if(i==n&&m==n){
		printf("YES");
	}
	else if(n==1){
		printf("NO");;
	}
	else if(s[i]!='*'){
		printf("NO2\n");
		printf("i=%d\n",i);
				printf("si=%c\n",s[i]);
				printf("n=%d,m=%d\n",n,m);
	}

	else {
	j=n-(i+1);
	k=0;
	while(j--){
		if(s[n-1-k]!=t[m-1-k]){
			pd=0;
			break;
		}

		else k++;
	}

	if(pd==0)printf("NO");
	else printf("YES");

	}

	return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <string>
#include<bits/stdc++.h>
using namespace std;

#define ss                string
#define fi              first
#define se              second
#define ll             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define vll              vector<ll>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define in               1e18
#define all(vect)       vect.begin(),vect.end()
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(t)            int t; cin>>t; while(t--)
#define fo(i,t1,t2)      for(int (i)=(t1);(i) < (t2); (i)++)
#define of(i,t1,t2)      for(int (i)=(t1);(i) >= (t2); (i)--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int main() {
    FIO;
    /* #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
     #endif*/
   int n,m;
   cin>>n>>m;
   int t1=0;
   ss s1,s2;
   cin>>s1>>s2;
   if(n==1 and s1[0]=='*'){
       cout<<"YES"<<endl;
       return 0;
   }
   if(m<n-1){
       cout<<"NO"<<endl;
       return 0;
   }
   int i=0;
   while(i<n and s1[i]!='*'){
       if(s1[i]!=s2[i]){
           t1=1;
           break;
       }
       i++;
   }
   //cout<<i<<endl;
   int j=i;
   if(i!=n-1){
       i++;
       //cout<<s1[i]<<endl;
       while(s2[j]!=s1[i] and j<m)
           j++;
       //cout<<j<<endl;
       while(i<n){
            if(s1[i]!=s2[j]){
                t1=1;
                break;
            }
            i++;
            j++;
       }
   }
   if(j!=m)
       t1=1;
   if(t1)
       cout<<"NO"<<endl;
   else
       cout<<"YES"<<endl;

}


#include <iostream>
#include <vector>
#include <set>
#include <string>
#include<bits/stdc++.h>
using namespace std;

#define ss                string
#define fi              first
#define se              second
#define ll             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define vll              vector<ll>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define in               1e18
#define all(vect)       vect.begin(),vect.end()
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(t)            int t; cin>>t; while(t--)
#define fo(i,t1,t2)      for(int (i)=(t1);(i) < (t2); (i)++)
#define of(i,t1,t2)      for(int (i)=(t1);(i) >= (t2); (i)--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int main() {
    FIO;
    /* #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
     #endif*/
   int n,m;
   cin>>n>>m;
   int t1=0;
   ss s1,s2;
   cin>>s1>>s2;
   if(m<n-1){
       cout<<"NO"<<endl;
       return 0;
   }
   int i=0;
   while(i<n and s1[i]!='*'){
       if(s1[i]!=s2[i]){
           t1=1;
           break;
       }
       i++;
   }
   //cout<<i<<endl;
   int j=i;
   if(i!=n-1){
       i++;
       //cout<<s1[i]<<endl;
       while(s2[j]!=s1[i] and j<m)
           j++;
       //cout<<j<<endl;
       while(i<n){
            if(s1[i]!=s2[j]){
                t1=1;
                break;
            }
            i++;
            j++;
       }
   }
   if(t1)
       cout<<"NO"<<endl;
   else
       cout<<"YES"<<endl;

}


#include <iostream>
#include <vector>
#include <set>
#include <string>
#include<bits/stdc++.h>
using namespace std;

#define ss                string
#define fi              first
#define se              second
#define ll             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define vll              vector<ll>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define in               1e18
#define all(vect)       vect.begin(),vect.end()
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(t)            int t; cin>>t; while(t--)
#define fo(i,t1,t2)      for(int (i)=(t1);(i) < (t2); (i)++)
#define of(i,t1,t2)      for(int (i)=(t1);(i) >= (t2); (i)--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int main() {
    FIO;
    /* #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
     #endif*/
   int n,m;
   cin>>n>>m;
   int t1=0;
   ss s1,s2;
   cin>>s1>>s2;
   if(m<n-1){
       cout<<"NO"<<endl;
       return 0;
   }
   int i=0;
   while(i<n and s1[i]!='*'){
       if(s1[i]!=s2[i]){
           t1=1;
           break;
       }
       i++;
   }
   //cout<<i<<endl;
   int j=i;
   if(i!=n-1){
       i++;
       //cout<<s1[i]<<endl;
       while(s2[j]!=s1[i] and j<m)
           j++;
       //cout<<j<<endl;
       while(i<n){
            if(s1[i]!=s2[j]){
                t1=1;
                break;
            }
            i++;
            j++;
       }
   }
   if(j!=m-1)
       t1=1;
   if(t1)
       cout<<"NO"<<endl;
   else
       cout<<"YES"<<endl;

}


#include <iostream>
#include <vector>
#include <set>
#include <string>
#include<bits/stdc++.h>
using namespace std;

#define ss                string
#define fi              first
#define se              second
#define ll             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define vll              vector<ll>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define in               1e18
#define all(vect)       vect.begin(),vect.end()
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(t)            int t; cin>>t; while(t--)
#define fo(i,t1,t2)      for(int (i)=(t1);(i) < (t2); (i)++)
#define of(i,t1,t2)      for(int (i)=(t1);(i) >= (t2); (i)--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int main() {
    FIO;
    /* #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
     #endif*/
   int n,m;
   cin>>n>>m;
   int t1=0;
   ss s1,s2;
   cin>>s1>>s2;
   if(n==1 and s1[0]=='*'){
       cout<<"YES"<<endl;
       return 0;
   }
   if(m<n-1){
       cout<<"NO"<<endl;
       return 0;
   }
   int i=0;
   while(i<n and s1[i]!='*'){
       if(s1[i]!=s2[i]){
           t1=1;
           break;
       }
       i++;
   }
   //cout<<i<<endl;
   int j=i;
   if(i!=n-1){
       i++;
       //cout<<s1[i]<<endl;
       while(s2[j]!=s1[i] and j<m)
           j++;
       //cout<<j<<endl;
       while(i<n and j<m){
            if(s1[i]!=s2[j]){
                t1=1;
                break;
            }
            i++;
            j++;
       }
   }
   if(j!=m or i!=n)
       t1=1;
   if(t1)
       cout<<"NO"<<endl;
   else
       cout<<"YES"<<endl;

}


package main

import "fmt"
//import "strconv"

func main() {

	var n int;

	fmt.Scan(&n);

	res := 0;

	for i := 1; i <= n; i++ {
		var a, b, c int;
		fmt.Scan(&a, &b, &c);

		sum := a + b + c;

		if(sum >= 2) {
			res++;
		}
	}
	fmt.Println(res);

}


package main

import "fmt"

func main() {
    var N, t int
    fmt.Scan(&N)
    res := 0
    for i := 0; i < N; i++ {
        val := 0
        for friend := 0; friend < 3; friend++ {
            fmt.Scan(&t)
            val += t
        }
        if val >= 2 {
            res += 1
        }
    }
    fmt.Println(res)
}


package main

import "fmt"

func main() {
    var N, t int
    fmt.Scan(&N)
    var cnt [1005]int
    for friend := 0; friend < 3; friend++ {
        for i := 0; i < N; i++ {
            fmt.Scan(&t)
            cnt[i] += t
        }
    }
    res := 0
    for _, number := range cnt {
        if number >= 2 {
            res += 1
        }
    }
    fmt.Println(res)
}


package main

import "fmt"

func main() {
	var amountOfProblems, problemsImplemented int
	problemsImplemented = 0
	fmt.Scanf("%d", &amountOfProblems)
	for i := 0; i < amountOfProblems; i++ {
		var friend1, friend2, friend3 int
		fmt.Scanf("%d %d %d\n", &friend1, &friend2, &friend3)
		if friend1+friend2+friend3 >= 2 {
			problemsImplemented++
		}
	}
	fmt.Println(problemsImplemented)
}


package main

import "fmt"

func main() {
	var amountOfProblems, problemsImplemented int
	problemsImplemented = 0
	fmt.Scanf("%d", &amountOfProblems)
	for i := 0; i < amountOfProblems; i++ {
		friend1, friend2, friend3 := 0, 0, 0
		fmt.Scanf("%d %d %d\n", &friend1, &friend2, &friend3)
		if friend1+friend2+friend3 == 2 || friend1+friend2+friend3 == 3 {
			problemsImplemented++
		}
	}
	fmt.Println(problemsImplemented)
}


package main

import "fmt"

func main() {
	var amountOfProblems, problemsImplemented int
	problemsImplemented = 0
	fmt.Scanf("%d", &amountOfProblems)
	for i := 0; i < amountOfProblems; i++ {
		var friend1, friend2, friend3 int
		fmt.Scanf("%d %d %d\n", &friend1, &friend2, &friend3)
		if friend1+friend2+friend3 == 2 || friend1+friend2+friend3 == 3 {
			problemsImplemented++
		}
	}
	fmt.Println(problemsImplemented)
}


package main

import "fmt"

func main() {
	var amountOfProblems, problemsImplemented int
	problemsImplemented = 0
	fmt.Scanf("%d\n", &amountOfProblems)
	for i := 0; i < amountOfProblems; i++ {
		friend1, friend2, friend3 := 0, 0, 0
		fmt.Scanf("%d %d %d\n", &friend1, &friend2, &friend3)
		if friend1+friend2+friend3 == 2 || friend1+friend2+friend3 == 3 {
			problemsImplemented++
		}
	}
	fmt.Println(problemsImplemented)
}


package main

import "fmt"

func main() {
	var amountOfProblems, problemsImplemented int
	problemsImplemented = 0
	fmt.Scanf("%d", &amountOfProblems)
	for i := 0; i < amountOfProblems; i++ {
		var friend1, friend2, friend3 int
		fmt.Scanf("%d %d %d", &friend1, &friend2, &friend3)
		if friend1+friend2+friend3 == 2 || friend1+friend2+friend3 == 3 {
			problemsImplemented++
		}
	}
	fmt.Println(problemsImplemented)
}


package main

import "fmt"

func main() {
	var n [1000]int
	var p int
	var v int
	var t int
	var number int

	fmt.Scanln(&p, &v, &t)

	for i := 0; i < n; i++ {
		fmt.Scan(&n[p, v, t])
	}

	for i := 0; i < n; i++ {
		if n[p, v, t] >= 2 && n[p, v, t] != 0 {
			number ++
		}
	}

	fmt.Println(number)
}


package main

import "fmt"

func main() {
	var n int
	var p int
	var v int
	var t int
	var number int

	fmt.Scanln(&n)

	for i := 0; i < n; i++ {
		fmt.Scan(&p, &v, &t)
		if p + v + t >= 2 {
			number++
		}
	}
	fmt.Println(number)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func main() {
	defer writer.Flush()

	var line string
	scanner := bufio.NewScanner(os.Stdin)
	i := 0
	n := 0
	total := 0
	for scanner.Scan() {
		if i == 0 {
			n, _ = strconv.Atoi(scanner.Text())
		} else {
			line = scanner.Text()
			votes := ArrayStringToInt(strings.Split(line, " "))
			if Run(votes[0], votes[1], votes[2]) {
				total++
			}
		}

		if i >= n {
			break
		}
		i++
	}

	printf("%d", total)
}

func Run(a, b, c int) bool {
	if a+b+c >= 2 {
		return true
	}
	return false
}

// Utils

func ArrayStringToInt(t []string) (t2 []int) {
	for _, i := range t {
		j, err := strconv.Atoi(i)
		if err != nil {
			panic(err)
		}
		t2 = append(t2, j)
	}
	return t2
}


package main

import "fmt"

func main() {
	var m, num int
	fmt.Scanf("%d", &m)

	for i := 0; i < m; i++ {
		var x, y, z int
		fmt.Scanf("%d %d %d", &x, &y, &z)
		if (z + y + x) > 1 {
			num++
		}

	}
	fmt.Println(num)

}


package main

import "fmt"

func main() {
	var m, num int
	fmt.Scanf("%d\n", &m)

	for i := 0; i < m; i++ {
		var x, y, z int
		fmt.Scanf("%d %d %d\n", &x, &y, &z)
		if (z + y + x) > 1 {
			num++
		}

	}
	fmt.Println(num)

}


package main

import "fmt"

func main() {
	var m int
	fmt.Scanf("%d", &m)
	var num int
	i := 1
	for i <= m {
		var a, b, c int
		fmt.Scanf("%d %d %d", &a, &b, &c)
		if (a + b + c) > 1 {
			num++
		}

		i++
	}
	fmt.Println(num)

}


package main

import "fmt"

func main() {
	var n int
	petya, vasya, tonya, counter := 0, 0, 0, 0
	fmt.Scanf("%d\n", &n)
	for i := 0; i < n; i++ {
		fmt.Scanf("%d %d %d\n", &petya, &vasya, &tonya)
		if petya+vasya+tonya >= 2 {
			counter++
		}
	}
	fmt.Print(counter)
}


package main

import "fmt"

func main() {
    var n int;
    petya, vasya, tonya, counter := 0,0,0,0
    fmt.Scanf("%d", &n)
    for i :=0; i < n; i++ {
      fmt.Scanf("%d %d %d", &petya, &vasya, &tonya)
      if petya + vasya + tonya >= 2 {
              counter++
      }
    }
    fmt.Print(counter)
}


package main

import "fmt"

func main() {
	var n int
	petya, vasya, tonya, counter := 0, 0, 0, 0
	fmt.Scanf("%d", &n)
	for i := 0; i < n; i++ {
		fmt.Scanf("%d %d %d", &petya, &vasya, &tonya)
		if petya+vasya+tonya >= 2 {
			counter++
		}
	}
	fmt.Print(counter)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	input := bufio.NewScanner(os.Stdin)
	hasInput := input.Scan()
	if hasInput == false {
		panic("Number of problems missing")
	}

	_, err := strconv.Atoi(input.Text())

	if err != nil {
		panic("Undefined number passed")
	}

	p := make([][]uint8, 0)

	for input.Scan() {
		elem := strings.Split(input.Text(), " ")

		mutated := []uint8{}
		for _, v := range elem {
			n, err := strconv.ParseInt(v, 10, 8)
			if err != nil {
				panic ("Undefined number in problemset")
			}

			mutated = append(mutated, uint8(n))
		}

		p = append(p, mutated)
	}

	fmt.Println(teamConsensus(p))

}

func teamConsensus(s [][]uint8) int {
	totalSum := 0
	for _, v := range s {
		sum := uint8(0)
		for _, w := range v {
			sum += w
		}

		if sum > 1 {
			totalSum += 1
		}
	}

	return totalSum
}


package main

import "fmt"

func main() {
	var nQues, cnt int
	fmt.Scan(&nQues)

	for ques := 0; ques < nQues; ques++ {
		var Petya, Vasya, Tonya int8
		fmt.Scan(&Petya, &Vasya, &Tonya)

		isSolved := Petya + Vasya + Tonya

		if isSolved >= 2 {
			cnt++
		}
	}

	fmt.Println(cnt)
}


package main

import (
	"fmt"
)

func main() {
  var n int
  var x, z, y uint8
  var probs int
  fmt.Scanf("%d\n", &n)
  for i := 0; i < n; i++ {
      fmt.Scanf("%d %d %d\n", &x, &y, &z)
      if(x+y+z>=2){
         probs++
      }
  }
  fmt.Println(probs)

}


package main

import (
	"fmt"
)

func main() {
	var n int
  //var a[][]uint8
  var x, z, y uint8
  var probs int
	fmt.Scanf("%d\n", &n)
  for i := 0; i < n; i++ {
    fmt.Scanf("%d %d %d\n", &x, &y, &z)
    //a = append(a, []uint8{x, y, z})
    if( (x==1 && y==1) || (x==1 && z==1) || (z==1 && y==1)){
      probs++
    }
  }
  fmt.Println(probs)

}


package main

import "fmt"

var n, a, b, c, ans int

func main() {
	fmt.Scanf("%d", &n)
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d%d%d", &a, &b, &c)
		a += b
		a += c
		if a >= 2 {
			ans++
		}
	}
	fmt.Println(ans)
}


package main

import (
	"fmt"
)

var n, a, b, c, ans int

func main() {
	fmt.Scanf("%d\n", &n)
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d%d%d\n", &a, &b, &c)
		a += b + c
		if a >= 2 {
			ans++
		}
	}
	fmt.Printf("%d\n", ans)
}


package main

import "fmt"

var n, a, b, c, ans int

func main() {
	fmt.Scanf("%d", &n)
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d %d %d", &a, &b, &c)
		a += b
		a += c
		if a >= 2 {
			ans++
		}
	}
	fmt.Println(ans)
}


package main

import (
	"fmt"
)

var n, a, b, c, ans int

func main() {
	fmt.Scan(&n)
	for i := 1; i <= n; i++ {
		fmt.Scan(&a, &b, &c)
		a += b + c
		if a >= 2 {
			ans++
		}
	}
	fmt.Printf("%d\n", ans)
}


package main

import (
	"fmt"
)

func main() {
	var n, ans int
	fmt.Scanf("%d", &n)
	for i := 1; i <= n; i++ {
		var a, b, c int
		fmt.Scanf("%d%d%d", &a, &b, &c)
		a = a + b
		a = a + c
		if a >= 2 {
			ans++
		}
	}
	fmt.Printf("%d\n", ans)
}


package main

import "fmt"

func main() {
	var n, a, b, c, ans int
	fmt.Scanf("%d", &n)
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d%d%d", &a, &b, &c)
		a += b
		a += c
		if a >= 2 {
			ans++
		}
	}
	fmt.Printf("%d\n", ans)
}


package main

import "fmt"

var n, a, b, c, ans int

func main() {
	fmt.Scanf("%d", &n)
	for i := 1; i <= n; i++ {
		fmt.Scanf("%d%d%d", &a, &b, &c)
		a += b + c
		if a >= 2 {
			ans++
		}
	}
	fmt.Println(ans)
}


package main

import (
	"fmt"
)

func main() {
	var n int64
	fmt.Scanf("%d\n", &n)

	var count int = 0
	for i := 0; int64(i) < n; i++ {
		var known map[int]int = make(map[int]int)
		var isKnown int
		var isKnown2 int
		var isKnown3 int
		fmt.Scanf("%d %d %d", &isKnown, &isKnown2, &isKnown3)

		known[isKnown]++
		known[isKnown2]++
		known[isKnown3]++

		if known[1] >= 2 {
			count++
		}
		fmt.Scanln()
	}

	fmt.Println(count)
}


package main

import "fmt"

func main(){
	var n int;
	ans := 0;
	fmt.Scan(&n);
	for i := 0; i < n; i++ {
		cache := 0;
		for j := 0; j < 3; j++ {
			var x int;
			fmt.Scan(&x);
			cache += x;
		}
		if cache >= 2{
			ans += 1;
		}
	}

	fmt.Println(ans);
}


package main

import "fmt"

//same code
func main() {
	var n int
	fmt.Scan(&n)
	sum := 0
	for i := 0; i < n; i++ {
		var p, q, r int
		fmt.Scan(&p, &q, &r)
		if (p + q + r) >= 2 {
			sum++
		}
	}
	fmt.Println(sum)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d", &n)
	sum := 0
	for i := 0; i < n; i++ {
		var p, q, r int
		fmt.Scanf("%d %d %d", &p, &q, &r)
		if (p + q + r) >= 2 {
			sum++
		}
	}
	fmt.Println(sum)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d", &n)
	sum := 0
	for i := 0;i < n; i++ {
		var p, q, r int
		fmt.Scanf("%d %d %d", &p, &q, &r)
		if (p + q + r) >= 2 {
			sum++
		}
	}
	fmt.Println(sum)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	sum := 0
	for i := 0; i < n; i++ {
		var p, q, r int
		fmt.Scan(&p, &q, &r)
		if (p + q + r) >= 2 {
			sum++
		}
	}
	fmt.Println(sum)
}


package main
import "fmt"

func main(){
	// your code goes here
	var n int
	fmt.Scan(&n)
	count := 0
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scan(&a)
		fmt.Scan(&b)
		fmt.Scan(&c)
		if a + b + c >= 2 {
			count += 1
		}
	}
	fmt.Println(count)
}


package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
	"strings"
)

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 1024 * 1024)
	nTemp, err := strconv.ParseInt(readLine(reader), 10, 64)

	checkError(err)
	x := int(nTemp)
	total := 0
	for i := 0; i < x; i++ {
		out := strings.Split(readLine(reader), " ")
		ints := make([]int, len(out))

		for i, s := range out {
			ints[i], _ = strconv.Atoi(s)
		}
		sum := 0
		for _, i := range ints {
			sum += i
		}
		if sum >= 2 {
			total += 1
		}
	}
	fmt.Println(total)
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}

func checkError(err error) {
	if err != nil {
		panic(err)
	}
}


package main

import ( "fmt" )

func main () {

	var i, n, a1, a2, a3 int
	fmt.Scan ( &i )

	for i > 0 {

		fmt.Scan ( &a1, &a2, &a3 )
		if ( a1 + a2 + a3 > 1 ) { n++ }

		i--
	}

	fmt.Println ( n )

}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var r = bufio.NewReader(os.Stdin)
var w = bufio.NewWriter(os.Stdout)

func print(f string, v ...interface{}) { fmt.Fprintf(w, f, v...) }
func scan(f string, v ...interface{})  { fmt.Fscanf(r, f, v...) }

func main() {
	defer w.Flush()
	var n, p, v, t, out int
	scan("%d\n", &n)
	for i := 0; i < n; i++ {
		scan("%d %d %d\n", &p, &v, &t)
		if p+v+t >= 2 {
			out++
		}
	}
	print("%d", out)
}


package main
import (
	"fmt"
)

func main() {
	var n int;
	fmt.Scan(&n);

	res := 0;
	for i := 1; i <= n; i ++ {
		cnt := 0;
		for j := 1; j <= 3; j ++ {
			x := 0;
			fmt.Scan(&x);
			cnt += x;
		}
		if(cnt > 1){
			res ++;
		}
	}
	fmt.Println(res);
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	var g [3]int
	var count int
	count = 0
	for i := 0; i < n; i++ {
		var sum int
		sum = 0
		for j := 0; j < 3; j++ {
			fmt.Scan(&g[j])
			sum += g[j]
		}
		if sum >= 2 {
			count += 1
		}
	}
	fmt.Println(count)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	var g [3]int
	var count int
	count = 0
	for i := 0; i < n; i++ {
		var sum int
		sum = 0
		for j := 0; j < 3; j++ {
			fmt.Scan(&g[i])
			sum += g[i]
		}
		if sum >= 2 {
			count += 1
		}
	}
	fmt.Println(count)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	var count int
	count = 0
	for i := 0; i < n; i++ {
		var p , v , t int
		var sum int
		sum = 0
		fmt.Scan(&p)
		fmt.Scan(&v)
		fmt.Scan(&t)

		if p == 1
			sum += 1
		if v == 1
			sum += 1
		if t == 1
			sum += 1
		if sum >= 2 {
			count += 1
		}
	}
	fmt.Println(count)
}


package main

import (
	"fmt"
)

func main() {
	var n, a, b, c, rez, sum int
	fmt.Scanln(&n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a, &b, &c)
		rez += a + b + c
		if rez >= 2 {
			sum++
		}
		rez = 0
	}
	fmt.Print(sum)
}


package main

import "fmt"

func main() {

	var arr [3]int
	var n, sum, cnt = 0, 0, 0
	fmt.Scan(&n)
	if n >= 1 && n <= 1000 {
		for i := 0; i < n; i++ {
			fmt.Scan(&arr[0], &arr[1], &arr[2])
			sum = arr[0] + arr[1] + arr[2]
			if sum >= 2 {
				cnt++
			}
		}
		fmt.Println(cnt)
	}
}


package main
import (
		"fmt"
		"strings"
		)

func main() {
	var input string
	fmt.Scan(&input)
	input = strings.ToLower(input)
	for i := 0; i < len(input); i++ {
		ch := input[i]
		if ch == 'a' || ch == 'o' || ch == 'y' || ch == 'e' || ch == 'u' || ch == 'i' {
			continue
		} else {
			fmt.Printf(".%c", ch)
		}
	}
}


package main
import "fmt"
func main() {
	var n, x, y, z int
	fmt.Scan(&n)
	answer := 0
	for i:=0; i<n; i++ {
		fmt.Scan(&x, &y, &z)
		if x+y+z >= 2 {
			answer++
		}
	}
	fmt.Print(answer)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {

	scanner := bufio.NewScanner(os.Stdin)

	var lines []string

	for scanner.Scan() {
		lines = append(lines, scanner.Text())
	}

	lines = lines[1:] // drop first element of array -> useless

	result := 0
	for _, line := range lines {
		split := strings.Split(line, " ")

		if len(split) != 3 { // three friends
			panic("invalid input")
		}

		succ := 0
		for _, d := range split {
			n, err := strconv.Atoi(d)
			if err != nil {
				panic("invalid input")
			}
			succ += n
		}

		if succ >= 2 { // at least two of them are sure about the solution.
			result++
		}
	}

	fmt.Println(result)
}


/* https://codeforces.com/problemset/problem/231/A
A. Team
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution. Otherwise, the friends won't write the problem's solution.

This contest offers n problems to the participants. For each problem we know, which friend is sure about the solution. Help the friends find the number of problems for which they will write a solution.

Input
The first input line contains a single integer n (1 ≤ n ≤ 1000) — the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Vasya's view on the solution, the third number shows Tonya's view. The numbers on the lines are separated by spaces.

Output
Print a single integer — the number of problems the friends will implement on the contest.

Examples
inputCopy
3
1 1 0
1 1 1
1 0 0
outputCopy
2
inputCopy
2
1 0 0
0 1 1
outputCopy
1
Note
In the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won't take it.

In the second sample the friends will only implement the second problem, as Vasya and Tonya are sure about the solution.
*/

package main

import "fmt"

func main() {
	var number_of_input_lines, surity int
	fmt.Scanf("%d\n", &number_of_input_lines)

	number_of_input_lines_for_slice := number_of_input_lines + 1

	for i := 1; i < number_of_input_lines_for_slice; i++ {
		//	for i, _ := range problems_slice {
		var petya, vasya, tonya int
		fmt.Scanf("%d %d %d\n", &petya, &vasya, &tonya)

		if petya+vasya+tonya >= 2 {
			surity = surity + 1
		}
	}

	fmt.Println(surity)
}


/* https://codeforces.com/problemset/problem/231/A
A. Team
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution. Otherwise, the friends won't write the problem's solution.

This contest offers n problems to the participants. For each problem we know, which friend is sure about the solution. Help the friends find the number of problems for which they will write a solution.

Input
The first input line contains a single integer n (1 ≤ n ≤ 1000) — the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Vasya's view on the solution, the third number shows Tonya's view. The numbers on the lines are separated by spaces.

Output
Print a single integer — the number of problems the friends will implement on the contest.

Examples
inputCopy
3
1 1 0
1 1 1
1 0 0
outputCopy
2
inputCopy
2
1 0 0
0 1 1
outputCopy
1
Note
In the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won't take it.

In the second sample the friends will only implement the second problem, as Vasya and Tonya are sure about the solution.
*/

package main

import "fmt"

func main() {
	var number_of_input_lines, petya, vasya, tonya, surity int
	fmt.Scanln(&number_of_input_lines)

	number_of_input_lines_for_slice := number_of_input_lines + 1

	for i := 1; i < number_of_input_lines_for_slice; i++ {

		fmt.Scanln(&petya, &vasya, &tonya)

		if petya+vasya+tonya >= 2 {
			surity++
		}
	}

	fmt.Println(surity)
}


/* https://codeforces.com/problemset/problem/231/A
A. Team
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution. Otherwise, the friends won't write the problem's solution.

This contest offers n problems to the participants. For each problem we know, which friend is sure about the solution. Help the friends find the number of problems for which they will write a solution.

Input
The first input line contains a single integer n (1 ≤ n ≤ 1000) — the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Vasya's view on the solution, the third number shows Tonya's view. The numbers on the lines are separated by spaces.

Output
Print a single integer — the number of problems the friends will implement on the contest.

Examples
inputCopy
3
1 1 0
1 1 1
1 0 0
outputCopy
2
inputCopy
2
1 0 0
0 1 1
outputCopy
1
Note
In the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won't take it.

In the second sample the friends will only implement the second problem, as Vasya and Tonya are sure about the solution.
*/

package main

import "fmt"

func main() {
	var number_of_input_lines, surity int
	fmt.Scanf("%d\n", &number_of_input_lines)

	number_of_input_lines_for_slice := number_of_input_lines + 1

	var problems_slice []int

	mathtesting := 0
	for i := 1; i < number_of_input_lines_for_slice; i++ {
		//	for i, _ := range problems_slice {
		var petya, vasya, tonya int
		fmt.Scanf("%d %d %d\n", &petya, &vasya, &tonya)

		mathtesting = petya + vasya + tonya
		problems_slice = append(problems_slice, mathtesting)
	}

	for _, value := range problems_slice {
		if value >= 2 {
			surity = surity + 1
		}
	}

	fmt.Println(surity)
}


package main

import (
	"fmt"
)

func main() {
	var n int
	res := 0
	fmt.Scanf("%d\n", &n)

	for i := 0; i < n; i++ {
		var a , b , c int
		fmt.Scanf("%d %d %d\n", &a , &b , &c)
        if a + b + c >= 2{
			res += 1
		}

	}

		fmt.Println(res)
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func main() {
	defer writer.Flush()

	var n int
	var arr [3]int
	scanf("%d\n", &n)
	ans := 0
	for n > 0 {
		count := 0
		for i := 0; i < 3; i++ {
			scanf("%d", &arr[i])
			if arr[i] > 0 {
				count++
			}
		}
		scanf("\n")
		if count > 1 {
			ans++
		}
		n--
	}

	printf("%d\n", ans)
}


package main

import (
	"fmt"
)

func main() {
	var n, p, v, t, buf int
	fmt.Scanln(&n)
	for i := 0; i < n; i++ {
		fmt.Scanln(&p, &v, &t)
		if p+v+t >= 2 {
			buf += 1
		}
	}
	fmt.Println(buf)
}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)

	sum := 0
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scanf("%d", &a)
		fmt.Scanf("%d", &b)
		fmt.Scanf("%d", &c)

		if a+b+c > 1 {
			sum++
		}
	}
	fmt.Println(sum)
}


package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	// reader := bufio.NewReader(os.Stdin)
	var n int
	var input string
	fmt.Scanln(&input)
	n, _ = strconv.Atoi(input)

	sum := 0
	for i := 0; i < n-1; i++ {
		fmt.Scanln(&input)
		s := strings.Split(input, " ")
		a, _ := strconv.Atoi(s[0])
		fmt.Scanln(&input)
		s = strings.Split(input, " ")
		b, _ := strconv.Atoi(s[0])
		fmt.Scanln(&input)
		s = strings.Split(input, " ")
		c, _ := strconv.Atoi(s[0])

		if a+b+c > 1 {
			sum++
		}
	}
	fmt.Println(sum)
}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)

	sum := 0
	for i := 0; i < n; i++ {
		a := 0
		b := 0
		c := 0
		fmt.Scanf("%d", &a)
		fmt.Scanf("%d", &b)
		fmt.Scanf("%d", &c)

		if a+b+c > 1 {
			sum = sum + 1
		}
	}
	fmt.Println(sum)
}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)

	sum := 0
	for i := 0; i < n; i++ {
		a := 0
		b := 0
		c := 0
		fmt.Scanf("%d", &a)
		fmt.Scanf("%d", &b)
		fmt.Scanf("%d", &c)

		if a+b+c > 1 {
			sum++
		}
	}
	fmt.Println(sum)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	var n int
	var input string
	fmt.Scanln(&input)
	n, _ = strconv.Atoi(input)

	sum := 0
	for i := 0; i < n; i++ {
		input, _ = reader.ReadString('\n')
		input = strings.Replace(input, "\n", "", -1)
		// fmt.Scanln(&input)
		s := strings.Split(input, " ")
		a, _ := strconv.Atoi(s[0])
		// fmt.Scanln(&input)
		// s = strings.Split(input, " ")
		b, _ := strconv.Atoi(s[1])
		// fmt.Scanln(&input)
		// s = strings.Split(input, " ")
		c, _ := strconv.Atoi(s[2])

		// fmt.Println("a, b, c:", a+b+c)
		if a+b+c > 1 {
			sum++
		}
	}
	fmt.Println(sum)
}


package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	sum := 0
	for i := 0; i < n; i++ {
		a := 0
		b := 0
		c := 0
		fmt.Scan(&a)
		fmt.Scan(&b)
		fmt.Scan(&c)

		if a+b+c > 1 {
			sum = sum + 1
		}
	}
	fmt.Println(sum)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	var n int
	var input string
	fmt.Scanln(&input)
	n, _ = strconv.Atoi(input)

	sum := 0
	for i := 0; i < n; i++ {
		input, _ = reader.ReadString('\n')
		// input = strings.Replace(input, "\n", "", -1)
		// fmt.Scanln(&input)
		s := strings.Split(input, " ")
		a, _ := strconv.Atoi(s[0])
		// fmt.Scanln(&input)
		// s = strings.Split(input, " ")
		b, _ := strconv.Atoi(s[1])
		// fmt.Scanln(&input)
		// s = strings.Split(input, " ")
		c, _ := strconv.Atoi(s[2])

		// fmt.Println("a, b, c:", a+b+c)
		if a+b+c > 1 {
			sum++
		}
	}
	fmt.Println(sum)
}


package main

import "fmt"

func main() {
	var n, pet, vas, ton, count int
	fmt.Scan(&n)

	for i := 0; i < n; i++ {
		fmt.Scan(&pet)
		fmt.Scan(&vas)
		fmt.Scan(&ton)

		if (pet == 1 && vas == 1) || (pet == 1 && ton == 1) || (vas == 1 && ton == 1) {
			count++
		}
	}
	fmt.Println(count)
}


package main

import(
	"fmt"
	"os"
)

var nContest int
var desicions [3]int
var solved int = 0

func isSolved() {
	count := 0
	for i := 0; i < 3; i++ {
		fmt.Fscan(os.Stdin, &desicions[i])
	}

	for i := 0; i < len(desicions); i++ {
		count = count + desicions[i]
	}

	if count >= 2 {
		solved+=1
	}
}

func main() {
	fmt.Fscan(os.Stdin, &nContest)
	for nContest > 0 {
		isSolved()
		nContest-=1
	}
	fmt.Println(solved)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	var res int = 0
	var petya, vasya, tonya int
	for n > 0 {
		fmt.Scan(&petya)
		fmt.Scan(&vasya)
		fmt.Scan(&tonya)
		if petya + vasya + tonya >= 2 {
			res++
		}
		n--
	}
	fmt.Println(res)
}


package main

import "fmt"

func main() {
	var n, res int
	fmt.Scanf("%d\n", &n)
	res = 0
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scanf("%d%d%d\n", &a, &b, &c)
		if a + b + c >= 2 {
			res = res + 1
		}
	}
	fmt.Println(res)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	res := 0
	for i := 0; i < n; i++ {
		var a, b, c int
		fmt.Scanf("%d%d%d", &a, &b, &c)
		if a + b + c >= 2 {
			res++
		}
	}
	fmt.Println(res)
}


package main

import (
	"fmt"
)

func main() {
	var m, n int
	res := 0

	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		sum := 0
		for j := 0; j < 3; j++ {
			fmt.Scan(&m)
			if m == 1 {
				sum++
			}
			if sum == 2 {
				res++
			}
		}
	}
	fmt.Println(res)
}


package main

import (
	"fmt"
)

func main() {
	var m, n int
	res := 0

	fmt.Scan(&n)
	for i := 0; i < n; i++ {
		sum := 0
		for j := 0; j < 3; j++ {
			fmt.Scan(&m)
			if m == 1 {
				sum++
			}
			if sum == 2 {
				res++
				sum = 0
			}
		}
	}
	fmt.Println(res)
}


package main

import "fmt"

func main() {
	var n, p1, p2, p3, res int
	fmt.Scanf("%d\n", &n)
	for i := 0; i < n; i++ {
	    fmt.Scanf("%d %d %d\n", &p1, &p2, &p3)
	    if p1+p2+p3 > 1 {
	        res++
	    }
	}
	fmt.Printf("%d\n", res)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	solution := 0
	for i := 0; i < n; i++ {
		var u, v, w int
		fmt.Scanf("%d %d %d", &u, &v, &w)
		if u+v+w >= 2 {
			solution += 1
		}
	}

	fmt.Print(solution)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	solution := 0
	for i := 0; i < n; i++ {
		var u, v, w int
		fmt.Scan(&u, &v, &w)
		if u+v+w >= 2 {
			solution += 1
		}
	}

	fmt.Print(solution)
}


package main

import "fmt"

func main() {
	var n int
	_, _ = fmt.Scan(&n)
	s := 0
	for i := 0; i < n; i++ {
		var p, v, t int
		_, _ = fmt.Scanln(&p, &v, &t)
		if p+v+t >= 2 {
			s += 1
		}
	}
	fmt.Print(s)
}


package main

import "fmt"

func main() {
	var n int
	_, _ = fmt.Scan(&n)
	s := 0
	for i := 0; i < n; i++ {
		var p, v, t int
		_, _ = fmt.Scan(&p, &v, &t)
		if p+v+t >= 2 {
			s += 1
		}
	}
	fmt.Println(s)
}


package main

import "fmt"

func main() {
	var n int
	_, _ = fmt.Scan(&n)
	s := 0
	for i := 0; i < n; i++ {
		var p, v, t int
		_, _ = fmt.Scanln(&p, &v, &t)
		if p+v+t >= 2 {
			s += 1
		}
	}
	fmt.Println(s)
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var n int

func main() {
	stdin := os.Stdin
	// stdin, _ = os.Open("1.in")
	reader := bufio.NewReaderSize(stdin, 1<<20)
	fmt.Fscanf(reader, "%d\n", &n)

	ans := 0
	for ; n != 0; n-- {
		var a, b, c int
		fmt.Fscanf(reader, "%d%d%d\n", &a, &b, &c)
		if a+b+c >= 2 {
			ans++
		}
	}

	fmt.Println(ans)
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	var n uint16
	var u uint16 = 0
	var a, b, c uint8
	fmt.Fscanf(in, "%d\n", &n)
	for i := 0; uint16(i) < n; i++ {
		fmt.Fscanf(in, "%d %d %d\n", &a, &b, &c)
		if a+b+c >= 2 {
			u++
		}
	}
	fmt.Println(u)
}


package main

import ("fmt")

func main() {
	var l int
	fmt.Scanf("%d\n", &l)
	var result = 0
	for l > 0 {
		var i, j, k int
		fmt.Scanf("%d %d %d\n", &i, &j, &k)
		if i + j + k > 1 {
			result = result + 1
		}
		l = l - 1;
	}
	fmt.Println(result)
}


package main

import "fmt"

func main() {
	var i int
	_, err := fmt.Scanf("%d\n", &i)
	if err != nil {
		panic(err)
	}

	for cpt := 0; cpt < i; cpt++ {
		var a, b, c int
		_, err = fmt.Scanf("%d %d %d\n", &a, &b, &c)

		if err != nil {
			panic(err)
		}

		// judging system bugs
		//r := 0

		if a+b+c >= 2 {
			//r++
			fmt.Println(1)
		} else {
			fmt.Println(0)
		}

		//fmt.Println(r)

	}

}


package main

import "fmt"

func main() {
	var i int
	_, err := fmt.Scanf("%d\n", &i)
	if err != nil {
		panic(err)
	}

	for cpt := 0; cpt < i; cpt++ {
		var a, b, c int
		_, err = fmt.Scanf("%d %d %d\n", &a, &b, &c)

		if err != nil {
			panic(err)
		}

		r := 0

		if a+b+c >= 2 {
			r++
		}

		fmt.Println(r)

	}

}


package main

import "fmt"

func main() {
	var i int
	_, err := fmt.Scanf("%d\n", &i)
	if err != nil {
		panic(err)
	}

	r := 0
	for cpt := 0; cpt < i; cpt++ {
		var a, b, c int
		_, err = fmt.Scanf("%d %d %d\n", &a, &b, &c)

		if err != nil {
			panic(err)
		}

		if a+b+c >= 2 {
			r++
		}

	}
	fmt.Println(r)

}


package main

import (
	"fmt"
)

func main() {

	var n, i, p, v, t, result int
	fmt.Scan(&n)

	for i = 0; i < n; i++ {
		fmt.Scan(&p, &v, &t)
		if p+v+t >= 2 {
			result++
		}
	}

	fmt.Print(result)

}


package main

import (
	"fmt"
)

func main() {

	var n, i, p, v, t, result int
	fmt.Scan(&n)

	for i = 0; i < n; i++ {
		fmt.Scan(&p, &v, &t)
		if (p == 1 && v == 1) || (p == 1 && t == 1) || (v == 1 && t == 1) {
			result++
		}
	}

	fmt.Print(result)

}


package main

import (
	"fmt"
	"io"
	"os"
)

func cf231a(in io.Reader, out io.Writer) {
	var n int
	var a, b, c int
	var total int
	fmt.Fscan(in, &n)
	for n > 0 {
		fmt.Fscan(in, &a, &b, &c)
		if (a == 1 && b == 1) || (c == 1 && b == 1) || (a == 1 && c == 1) {
			total++
		}
		n--
	}

	fmt.Println(total)

}

func main() { cf231a(os.Stdin, os.Stdout) }


package main

import (
	"fmt"
)

func main() {
	var questionCount int
	fmt.Scanf("%d\n", &questionCount)

	implementationCount := 0
	for i := 0; i < questionCount; i++ {
		var p1, p2, p3 int
		fmt.Scanf("%d %d %d\n", &p1, &p2, &p3)
		if p1+p2+p3 > 1 {
			implementationCount++
		}
	}

	fmt.Println(implementationCount)
}


package main

import "fmt"

func main() {
	var n int
	var ans int
	fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var x, y, z int
		fmt.Scan(&x, &y, &z)
		if x+y+z >= 2 {
			ans++
		}
	}
	fmt.Println(ans)

}


package  main
import ("fmt")

func main(){
	var x,y,z,n int
	fmt.Scan(&n);
	c:=0
	for i:=0;i<n;i++{
		fmt.Scanf("%d %d %d",&x,&y,&z)

		var ad = x+y+z
		if(ad>=2){
			c++
		}
	}
	fmt.Print(c)
}


package  main
import ("fmt")

func main(){
	var x ,y,z,n int
	fmt.Scan(&n);
	c:=0
	for i:=0;i<n;i++{
		//fmt.Scanf("%d %d %d\n",&x,&y,&z)

		/*fmt.Scan(&x);
		fmt.Scan(&y);
		fmt.Scan(&z);*/

		fmt.Scan(&x , &y ,&z);

		var ad = x+y+z
	//	fmt.Print(ad)
		if(ad>=2){
			c++
		}
	}
	fmt.Print(c)
}


package  main
import ("fmt")

func main(){
	var x ,y,z,n int
	fmt.Scan(&n);
	c:=0
	for i:=0;i<n;i++{
		//fmt.Scanf("%d %d %d\n",&x,&y,&z)

		fmt.Scan(&x);
		fmt.Scan(&y);
		fmt.Scan(&z);

		var ad = x+y+z
		//fmt.Print(ad)
		if(ad>=2){
			c++
		}
	}
	fmt.Print(c)
}


package main

import "fmt"

func main() {
	var T int
	fmt.Scanf("%d\n", &T)
	ans := 0
	var a,b,c int
	for i := 0; i < T; i++ {
		fmt.Scanf("%d%d%d\n", &a, &b, &c)
		if a + b + c >= 2{
			ans ++
		}
	}
	fmt.Printf("%d\n", ans)
}


package main

import "fmt"

func main() {
	var T int
	fmt.Scanf("%d", &T)
	ans := 0
	for i := 0; i < T; i++ {
		var a,b,c int
		fmt.Scanf("%d%d%d", &a, &b, &c)
		if a + b + c >= 2{
			ans ++
		}
	}
	fmt.Printf("%d\n", ans)
}


package main

import "fmt"

func main() {
	var T int
	fmt.Scanf("%d\n", &T)
	ans := 0
	for i := 0; i < T; i++ {
		var a,b,c int
		fmt.Scanf("%d%d%d", &a, &b, &c)
		if a + b + c >= 2{
			ans ++
		}
	}
	fmt.Printf("%d\n", ans)
}


package main

import (
        "fmt"
)

func main() {
        var (
                inputnum int
                input1   int
                input2   int
                input3   int
        )
        fmt.Scanf("%d", &inputnum)
        var output int
        for i := 0; i < inputnum; i++ {
                fmt.Scanf("%d %d %d", &input1, &input2, &input3)
                if input1+input2+input3 >= 2 {
                        output += 1
                }
        }
        fmt.Println(output)
}


package main

import (
        "fmt"
)

func main() {
        var (
                inputnum int
                input1   int
                input2   int
                input3   int
        )
        fmt.Scan(&inputnum)
        output := 0
        for i := 0; i < inputnum; i++ {
                fmt.Scan(&input1, &input2, &input3)
                if input1+input2+input3 >= 2 {
                        output += 1
                }
        }
        fmt.Println(output)
}


package main

import (
        "fmt"
)

func main() {
        var inputnum int
        fmt.Scan(&inputnum)
        output := 0
        for i := 0; i < inputnum; i++ {
                var (
                        input1 int
                        input2 int
                        input3 int
                )
                fmt.Scan(&input1, &input2, &input3)
                if input1+input2+input3 >= 2 {
                        output += 1
                }
        }
        fmt.Println(output)
}


package main

import (
        "fmt"
)

func main() {
        var (
                inputnum int
                input1   int
                input2   int
                input3   int
        )
        fmt.Scanf("%d", &inputnum)
        output := 0
        for i := 0; i < inputnum; i++ {
                fmt.Scanf("%d %d %d", &input1, &input2, &input3)
                if input1+input2+input3 >= 2 {
                        output += 1
                }
        }
        fmt.Println(output)
}


package main

import (
        "fmt"
)

func main() {
        var inputnum int
        fmt.Scanf("%d", &inputnum)
        output := 0
        for i := 0; i < inputnum; i++ {
                var (
                        input1 int
                        input2 int
                        input3 int
                )
                fmt.Scanf("%d %d %d", &input1, &input2, &input3)
                if input1+input2+input3 >= 2 {
                        output += 1
                }
        }
        fmt.Println(output)
}


package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	var ans = 0
	for i := 0; i < n; i++ {
		var p, v, t int
		fmt.Scan(&p, &v, &t)

		var s = p + v + t

		if s > 1 {
			ans++
		}
	}

	fmt.Println(ans)
}


package main

import "fmt"

func solve(a, b, c int) int {
	var doesagree bool
	var finalcount int
	if a+b+c < 2 {
		doesagree = false
	} else {
		doesagree = true
	}
	if doesagree {
		finalcount = finalcount + 1
	}
	return finalcount
}

func main() {
	var testcases int
	var sum int
	arr := make([]int, 3)
	if _, err := fmt.Scan(&testcases); err != nil {
		panic(err)
	}

	for testcases != 0 {
		for i := 0; i < 3; i++ {
			if _, err := fmt.Scan(&arr[i]); err != nil {
				panic(err)
			}
		}
		var a, b, c int
		a, b, c = arr[0], arr[1], arr[2]
		sum += solve(a, b, c)
		testcases = testcases - 1
	}
	fmt.Println(sum)
}


package main

import (
	"bufio"
	"fmt"
  "os"
	"strconv"
	"strings"

	"github.com/CyrusJavan/codeforces/util"
)

func main() {
	if err := run(os.Args[1:]); err != nil {
	  fmt.Println(err)
	}
}

func run(args []string) error {
	reader := bufio.NewReader(os.Stdin)

	text, err := reader.ReadString('\n')
	if err != nil {
		return err
	}
	text = util.CRLFReplacer.Replace(text)

	lines, err := strconv.Atoi(text)
	if err != nil {
		return err
	}

	problems := 0

	for i := 0; i < lines; i++ {
		text, err := reader.ReadString('\n')
		if err != nil {
			return err
		}
		text = util.CRLFReplacer.Replace(text)

		parts := strings.Split(text, " ")
		agree := 0
		for _, v := range parts {
			if v == "1" {
				agree++
			}
		}
		if agree >= 2 {
			problems++
		}
	}

	fmt.Println(problems)
	return nil
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	if err := run(os.Args[1:]); err != nil {
	  fmt.Println(err)
	}
}

var CRLFReplacer = strings.NewReplacer("\n", "", "\r", "")

func run(args []string) error {
	reader := bufio.NewReader(os.Stdin)

	text, err := reader.ReadString('\n')
	if err != nil {
		return err
	}
	text = CRLFReplacer.Replace(text)

	lines, err := strconv.Atoi(text)
	if err != nil {
		return err
	}

	problems := 0

	for i := 0; i < lines; i++ {
		text, err := reader.ReadString('\n')
		if err != nil {
			return err
		}
		text = CRLFReplacer.Replace(text)

		parts := strings.Split(text, " ")
		agree := 0
		for _, v := range parts {
			if v == "1" {
				agree++
			}
		}
		if agree >= 2 {
			problems++
		}
	}

	fmt.Println(problems)
	return nil
}


package main

import "fmt"

func main() {
    var n int
    var a, b, c int
    var result int = 0

    fmt.Scan(&n)
    for i := 0; i < n; i++ {
        fmt.Scan(&a, &b, &c)
        if a + b + c >= 2 {
            result++
        }
    }
    fmt.Println(result)
}


#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#define fors for(int i=0;i<s.size();i++)
#define lli long long int
#define mod 1000000007
#define ull unsigned long long
#define forin for(int i=0;i<n;i++)
#define testcase int t;cin>>t;while(t--)
using namespace std;
class gfg
{
public :
  lli gcd(lli a, lli b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

  // Function to return LCM of two numbers
  lli lcm(lli a, lli b)
  {
     return (a*b)/gcd(a, b);
  }
} ;
int main()
{
	testcase{
	lli n;
	cin>>n;
	if(n==1){cout<<"FastestFinger"<<endl;continue;}
	lli a = n;
	if(n%2==1)
	{cout<<"Ashishgup"<<endl;continue;}
	int x=0;
	while(n>1)
	{	if(n%2==0){n/=2;x++;}
		else{break;}
		if(x>1){break;}
	}
	//cout<<a<<endl;
	int y=0;
	vector<int>divisors;
	for(int i=3;i<=a;i+=2)
	{
		divisors.push_back(i);
	}
	//cout<<y<<endl;;
	for(int i=0;i<divisors.size();i++)
	{
		while(a%divisors[i]==0)
		{a/=divisors[i];y++;}
	}
	//cout<<y;

	if(x==1)
	{
		if(y==0)
		{cout<<"Ashishgup"<<endl;continue;}
		if(y>1)
		{cout<<"Ashishgup"<<endl;}
		else
		{cout<<"FastestFinger"<<endl;}

	}
	if(x>1)
	{if(y>0)cout<<"Ashishgup"<<endl;
	else cout<<"FastestFinger"<<endl;}
}}


#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#define fors for(int i=0;i<s.size();i++)
#define lli long long int
#define mod 1000000007
#define ull unsigned long long
#define forin for(int i=0;i<n;i++)
#define testcase int t;cin>>t;while(t--)
using namespace std;
class gfg
{
public :
  lli gcd(lli a, lli b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

  // Function to return LCM of two numbers
  lli lcm(lli a, lli b)
  {
     return (a*b)/gcd(a, b);
  }
} ;
int main()
{
	testcase{
	lli n;
	cin>>n;
	if(n==1){cout<<"FastestFinger"<<endl;continue;}
	if(n==2){cout<<"Ashishgup"<<endl;continue;}
	lli a = n;
	if(n%2==1)
	{cout<<"Ashishgup"<<endl;continue;}
	int x=0;
	while(n>1)
	{	if(n%2==0){n/=2;x++;}
		else{break;}
		if(x>1){break;}
	}
	//cout<<a<<endl;
	int y=0;
	//vector<int>divisors;
	for(int i=3;i*i<=a;i++)
	{
		//cout<<i<<endl;
		lli temp = a;
		if(i%2==1)
		{while(temp>1)
		{
			if(temp%i==0)
			{temp/=i;y++;}
			else{break;}
			if(y>1)break;
		}}
		temp = a;
		lli j = a/i;
		if(j%2==1)
		{while(temp>1)
		{
			if(temp%j==0)
			{temp/=j;y++;}
			else{break;}
			if(y>1)break;
		}}

	}
	int c = a/2;

	if((a/2)%2==1)
	{y++;}
	//cout<<y<<endl;;
	//cout<<x<<" "<<y<<endl;
	if(x==1)
	{
		if(y==0)
		{cout<<"Ashishgup"<<endl;continue;}
		if(y>1)
		{cout<<"Ashishgup"<<endl;}
		else
		{cout<<"FastestFinger"<<endl;}

	}
	if(x>1)
	{if(y>0)cout<<"Ashishgup"<<endl;
	else cout<<"FastestFinger"<<endl;}
}}


#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#define fors for(int i=0;i<s.size();i++)
#define lli long long int
#define mod 1000000007
#define ull unsigned long long
#define forin for(int i=0;i<n;i++)
#define testcase int t;cin>>t;while(t--)
using namespace std;
class gfg
{
public :
  lli gcd(lli a, lli b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

  // Function to return LCM of two numbers
  lli lcm(lli a, lli b)
  {
     return (a*b)/gcd(a, b);
  }
} ;
int main()
{
	testcase{
	lli n;
	cin>>n;
	if(n==1){cout<<"FastestFinger"<<endl;continue;}
	if(n==2){cout<<"Ashishgup"<<endl;continue;}
	lli a = n;
	if(n%2==1)
	{cout<<"Ashishgup"<<endl;continue;}
	int x=0;
	while(n>1)
	{	if(n%2==0){n/=2;x++;}
		else{break;}
		if(x>1){break;}
	}
	//cout<<a<<endl;
	int y=0;
	//vector<int>divisors;
	for(int i=3;i*i<=a;i+=2)
	{
		//cout<<i<<endl;
		lli temp = a;
		while(temp>1)
		{
			if(temp%i==0)
			{temp/=i;y++;}
			else{break;}
			if(y>1)break;
		}

	}
	int c = a/2;

	if((a/2)%2==1)
	{y++;}
	//cout<<y<<endl;;
	//cout<<x<<" "<<y<<endl;
	if(x==1)
	{
		if(y==0)
		{cout<<"Ashishgup"<<endl;continue;}
		if(y>1)
		{cout<<"Ashishgup"<<endl;}
		else
		{cout<<"FastestFinger"<<endl;}

	}
	if(x>1)
	{if(y>0)cout<<"Ashishgup"<<endl;
	else cout<<"FastestFinger"<<endl;}
}}


#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#define fors for(int i=0;i<s.size();i++)
#define lli long long int
#define mod 1000000007
#define ull unsigned long long
#define forin for(int i=0;i<n;i++)
#define testcase int t;cin>>t;while(t--)
using namespace std;
class gfg
{
public :
  lli gcd(lli a, lli b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

  // Function to return LCM of two numbers
  lli lcm(lli a, lli b)
  {
     return (a*b)/gcd(a, b);
  }
} ;
int main()
{
	testcase{
	lli n;
	cin>>n;
	if(n==1){cout<<"FastestFinger"<<endl;continue;}
	lli a = n;
	if(n%2==1)
	{cout<<"Ashishgup"<<endl;continue;}
	int x=0;
	while(n>1)
	{	if(n%2==0){n/=2;x++;}
		else{break;}
		if(x>1){break;}
	}
	//cout<<a<<endl;
	int y=0;
	for(int i=3;i<=a;i+=2)
	{
		//cout<<i<<endl;
		while(a>1)
		{
			if(a%i==0)
			{a/=i;y++;}
			else{break;}
		}

	}
	//cout<<y<<endl;;

	if(x==1)
	{
		if(y==0)
		{cout<<"Ashishgup"<<endl;continue;}
		if(y>1)
		{cout<<"Ashishgup"<<endl;}
		else
		{cout<<"FastestFinger"<<endl;}

	}
	if(x>1)
	{if(y>0)cout<<"Ashishgup"<<endl;
	else cout<<"FastestFinger"<<endl;}
}}


#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#define fors for(int i=0;i<s.size();i++)
#define lli long long int
#define mod 1000000007
#define ull unsigned long long
#define forin for(int i=0;i<n;i++)
#define testcase int t;cin>>t;while(t--)
using namespace std;
class gfg
{
public :
  lli gcd(lli a, lli b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

  // Function to return LCM of two numbers
  lli lcm(lli a, lli b)
  {
     return (a*b)/gcd(a, b);
  }
} ;
int main()
{
	testcase{
	lli n;
	cin>>n;
	if(n==1){cout<<"FastestFinger"<<endl;continue;}
	lli a = n;
	if(n%2==1)
	{cout<<"Ashishgup"<<endl;continue;}
	int x=0;
	while(n>1)
	{	if(n%2==0){n/=2;x++;}
		else{break;}
		if(x>1){break;}
	}
	//cout<<a<<endl;
	int y=0;
	vector<int>divisors;
	for(int i=3;i<=a;i+=2)
	{
		//cout<<i<<endl;
		lli temp = a;
		while(temp>1)
		{
			if(temp%i==0)
			{temp/=i;y++;}
			else{break;}
		}

	}
	//cout<<y<<endl;;

	if(x==1)
	{
		if(y==0)
		{cout<<"Ashishgup"<<endl;continue;}
		if(y>1)
		{cout<<"Ashishgup"<<endl;}
		else
		{cout<<"FastestFinger"<<endl;}

	}
	if(x>1)
	{if(y>0)cout<<"Ashishgup"<<endl;
	else cout<<"FastestFinger"<<endl;}
}}


#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#define fors for(int i=0;i<s.size();i++)
#define lli long long int
#define mod 1000000007
#define ull unsigned long long
#define forin for(int i=0;i<n;i++)
#define testcase int t;cin>>t;while(t--)
using namespace std;
class gfg
{
public :
  lli gcd(lli a, lli b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

  // Function to return LCM of two numbers
  lli lcm(lli a, lli b)
  {
     return (a*b)/gcd(a, b);
  }
} ;
int main()
{
	testcase{
	lli n;
	cin>>n;
	if(n==1){cout<<"FastestFinger"<<endl;continue;}
	lli a = n;
	if(n%2==1)
	{cout<<"Ashishgup"<<endl;continue;}
	int x=0;
	while(n>1)
	{	if(n%2==0){n/=2;x++;}
		else{break;}
		if(x>1){break;}
	}
	//cout<<a<<endl;
	int y=0;
	vector<int>divisors;
	for(int i=3;i*i<=a;i+=2)
	{
		//cout<<i<<endl;
		lli temp = a;
		while(temp>1)
		{
			if(temp%i==0)
			{temp/=i;y++;}
			else{break;}
			if(y>1)break;
		}

	}
	//cout<<y<<endl;;

	if(x==1)
	{
		if(y==0)
		{cout<<"Ashishgup"<<endl;continue;}
		if(y>1)
		{cout<<"Ashishgup"<<endl;}
		else
		{cout<<"FastestFinger"<<endl;}

	}
	if(x>1)
	{if(y>0)cout<<"Ashishgup"<<endl;
	else cout<<"FastestFinger"<<endl;}
}}


#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#define fors for(int i=0;i<s.size();i++)
#define lli long long int
#define mod 1000000007
#define ull unsigned long long
#define forin for(int i=0;i<n;i++)
#define testcase int t;cin>>t;while(t--)
using namespace std;
class gfg
{
public :
  lli gcd(lli a, lli b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
 }

  // Function to return LCM of two numbers
  lli lcm(lli a, lli b)
  {
     return (a*b)/gcd(a, b);
  }
} ;
int main()
{
	testcase{
	lli n;
	cin>>n;
	if(n==1){cout<<"FastestFinger"<<endl;continue;}
	lli a = n;
	if(n%2==1)
	{cout<<"Ashishgup"<<endl;continue;}
	int x=0;
	while(n>1)
	{	if(n%2==0){n/=2;x++;}
		else{break;}
		if(x>1){break;}
	}
	//cout<<a<<endl;
	int y=0;
	//vector<int>divisors;
	for(int i=3;i*i<=a;i+=2)
	{
		//cout<<i<<endl;
		lli temp = a;
		while(temp>1)
		{
			if(temp%i==0)
			{temp/=i;y++;}
			else{break;}
			if(y>1)break;
		}

	}
	if((n/2)%2==1)
	{y++;}
	//cout<<y<<endl;;

	if(x==1)
	{
		if(y==0)
		{cout<<"Ashishgup"<<endl;continue;}
		if(y>1)
		{cout<<"Ashishgup"<<endl;}
		else
		{cout<<"FastestFinger"<<endl;}

	}
	if(x>1)
	{if(y>0)cout<<"Ashishgup"<<endl;
	else cout<<"FastestFinger"<<endl;}
}}