#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define M 1000000007
#define ll long long int
#define F first
#define S second
#define INF (int)1000000000
const int N = 1e5+5;
#define maax(a,b,c) max((int)a,max((int)b,(int)c))
#define miin(a,b,c) min((int)a,min((int)b,(int)c))
#define mp make_pair
#define int long long
#define all(a) a.begin(),a.end()
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define inf (long long) 1e18
#define vl vector<ll>
#define sz(a) (ll)a.size()
#define I insert
#define mem(a,b) memset(a,b,sizeof(a))
#define fr(i,m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define fre(i,m, n) for (int i = (int)(n); i <= (int)(m); i--)
#define rall(x) (x).rbegin(), (x).rend()
#define TIME    cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
//void __print(int x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}//
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
typedef pair<int, int> PII;
int aa[100005];
int gcd(int a,int b)
{
	if(b==0) return a;
	else return gcd(b,a%b);
}
bool is_prime(int n)
{
	if(n==1) return true;
	int g=sqrt(n);
	for(int i=2;i<=g;i++)
	{
		if(n%i==0) return true;
	}
	return false;
}
int b[N];
int check(int n)
{
	if(b[n]!=0) return b[n];
	int h=0,y=n;
	while(n)
	{
		h++,n/=10;
	}
	b[y]=h;
	return h;
}
int a[100000000];
int aha(int n)
{int y=0;
    while(n%10!=0) n/=10;
	while(n)
	{
		y+=n%10;n/=10;
	}
	return y;
}
int lol(int n)
{
	int y=0;
	fr(i,1,INF)
	{
		if(a[i]!=0) y=a[i];
		else 
		{
			if(i%10==0) y=aha(i);
			else y++;
		}
		a[i]=y;//debug(i,y);
		if(y==n) return i; 
	}
	return 0;
}

int poo()
{
    string a,b;cin>>a>>b;string g=b;
    sort(all(a)),sort(all(g));int y=0;
    fr(i,0,a.size())
    {
    	if(a[i]==g[y]) 
		{
		   a.erase(a.begin()+i,a.begin()+(i+1));	
		   y++,i--;
	    }
	}
	y=0;
	fr(i,0,a.size())
	{
		debug(a,b);
		if(a[i]<=b[y] || y==b.size())
		{
			cout<<a[i];
		}
		else 
		{
		cout<<b[y],y++,i--;}
	}
	//debug(a,b);
	return 0;
}
int32_t main()
{
	ios::sync_with_stdio(0); cin.tie(0);
//    int t;cin>>t;//int y=aha(28000);cout<<y<<" ";
//    while(t--) poo();
    int a[5];map<int,int>m;
    fr(i,0,5) cin>>a[i],m[a[i]]=i+1;
    cout<<m[0];
    return 0;	
} 

Measured memory_bytes: 3612