    #include <bits/stdc++.h>
    #define FILES freopen("intput.txt", "r", stdin); /*freopen("output.txt", "w", stdout)*/
    #define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
    #define FIXED cout << fixed << setprecision(20)
    #define pb push_back
    #define pf push_front
    #define popb pop_back
    #define popf pop_front
    #define mp make_pair
    #define eps 1e-9
    #define mod 1000000007
    #define f first
    #define s second

    using namespace std;

    typedef long long ll;
    typedef pair<ll, ll> pll;
    typedef long double ld;
    typedef vector <vector<ll> > graf;
    typedef pair< ld, ld> pld;

    using namespace std;
    ll n,t;
    graf a;
    vector<ll> met;
    void dfs(ll k){
    met[k]=1;
    for(int i=0; i<a[k].size(); i++) {
     if(met[a[k][i]]==0) dfs(a[k][i]);
    }
    }
    ll nod (ll a, ll b){
    if(b==0) return a;
    else return nod(b,a%b);
    }
    ll comp(ll a, ll b){
     return nod(a,b);
    }
    ll f(ll a, ll b){
    if(a==b) return 0;
    if(a==0) {
     if(b==1) return -1;
     else return 1;
    }
    if(a==1){
     if(b==2) return -1;
     else return 1;
    }
    if(a==2) {
        if(b==0) return -1;
        else return 1;
    }
    }
    int main() {
    FAST;
    ll n=5,r=0;
    vector<ll> a(6,0);
    for(int i=1; i<=5; i++) cin>>a[i];
    bool tt=0;
    while(tt==0){
    a[1]-=1; if(a[1]<0) tt=1;
    a[2]-=1; if(a[2]<0) tt=1;
    a[3]-=2; if(a[3]<0) tt=1;
    a[4]-=7; if(a[4]<0) tt=1;
    a[5]-=4; if(a[5]<0) tt=1;
    if(tt==1) break;
    r++;
    }
    cout<<r;
    }

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	c/=2;d/=7;e/=4;
	cout<<min(a,min(b,min(c,min(d,e))));
	return 0;
}

#include <stdio.h>
#include <string.h>
int main()
{
    int a, b, c, d, e,len1, len2, i, min;
    while(~scanf("%d %d %d %d %d", &a, &b, &c, &d, &e))
    {
        min = 1000;
        if(a < min)
        {
            min = a;
        }
        if(b < min)
        {
            min = b;
        }
        if(c/2 < min)
        {
            min = c/2;
        }
        if(d/7 < min)
        {
            min = d/7;
        }
        if(e/4 < min)
        {
            min = e/4;
        }
        printf("%d\n", min);
    }
}

/*
		.......The dark religions are departed & sweet science reigns.......
																		----William Blake,Vala(The Four Zoas), 1797
*/
#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef priority_queue< pii,std::vector<pii>,greater<pii> > maxheap;

#define pb 				push_back
#define mp 				make_pair
#define sz(a)			ll(a.size())
#define rep(i,a,b) 		for(int i=a;i<b;i++)
#define repR(i,a,b) 	for(int i=a;i>=b;i--)
#define check1(x)		cout << x << endl
#define check2(x,y)		cout << x << "=>" << y << endl
#define check3(x,y,z)	cout << x << "=>" << y << "=>" << z << endl
#define F 				first
#define S 				second
#define fifo			ios_base::sync_with_stdio(0)
#define cintie			cin.tie(0)
#define couttie			cout.tie(0)

const long long int mod=1e9+7;
const long long int N=1e5+5;
ll rp[5];
int main()
{
	fifo,cintie,couttie;
	rep(i,0,5)
	{
		cin >> rp[i];
	}
	ll stones=min(rp[0],rp[1]);
	stones=min(stones,rp[2]/2);
	stones=min(stones,rp[3]/7);
	stones=min(stones,rp[4]/4);
	cout << stones << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,ans;
int main(){
	cin>>a>>b>>c>>d>>e;
	ans=99999999;
	ans=min(ans,min(a,b));
	ans=min(ans,c/2);
	ans=min(ans,d/7);
	ans=min(ans,e/4);
	cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e;
int main(){
    scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
    cout<<min(a,min(b,min(c/2,min(d/7,e/4))));
    return 0;
}

//

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e;
main(){
  	cin>>a>>b>>c>>d>>e;
  	cout<<min(a,min(b,min(c/2,min(d/7,e/4))));
}

/* (Codeforces)     ::

    coded by-> @draco_nian
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long lld;

#define    MAX       500005
#define    pb        push_back
#define  rep(i,a,b)  for(lld i=a;i<b;i++)
#define  repe(i,a,b) for(lld i=a;i<=b;i++)
#define  reps(it,o)  for(auto it=o.begin();it!=o.end();it++)

int main()
{
  std::ios::sync_with_stdio(false);
  lld a[5];
  rep(i,0,5)
  {
  	  cin>>a[i];
  }
  cout<<min(a[0],min(a[1],min(a[2]/2,min(a[3]/7,a[4]/4))));

}

#include <bits/stdc++.h> //JuniorMonster a.k.a Sho10
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define mod 1000000007
using namespace std;
ll n,a[5];
int32_t main(){
cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4];
cout<<min(a[0],min(a[1],min(a[2]/2,min(a[3]/7,a[4]/4))));
return 0;}

#include<iostream>
using namespace std;
int main(){
	int a,b,c,d,e,f=0;
	cin>>a>>b>>c>>d>>e;
	while (1){
		if (a>=1){
			a=a-1;
			f++;
		}
		else break;
		if (b>=1){
			b=b-1;
			f++;
		}
		else break;
		if (c>=2){
			c=c-2;
			f++;
		}
		else break;
		if (d>=7){
			d=d-7;
			f++;
		}
		else break;
		if (e>=4){
			e=e-4;
			f++;
		}
		else break;
	}
	cout<<f/5<<endl;
	return 0;
}

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>

#define fi(i, a, b) for ((i) = (a); (i) < (b); ++(i))

using namespace std;

int main()
{
#if defined(DEBUG) || defined(_DEBUG)
    ifstream cin("input.txt");
    ofstream cout("output.txt");
#endif
    int ans[5];
    int del[5] = {1, 1, 2, 7, 4};
    int res = 100500;
    for (int i = 0; i < 5; ++i)
    {
        cin >> ans[i];
        ans[i] /= del[i];
        if (ans[i] < res)
            res = ans[i];
    }
    cout << res;
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    cout<<min(a,min(b,min(c/2,min(d/7,e/4))));
    return 0;
}

#include <iostream>
using namespace std;
int main ()
{
	int a[5], b, c, d, e, f;
	cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4];
	b = a[0];
	c = a[1];
	d = a[2] / 2;
	e = a[3] / 7;
	f = a[4] / 4;
	cout<<min(min(min(min(b, c), d), e), f);
	return 0;
}

#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <stdlib.h>
#include <cmath>
#include <vector>

#define x first
#define y second

using namespace std;

int main(){

    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    c /= 2;
    d /= 7;
    e /= 4;
    cout << min(a, min(b, min(c, min(d, e))));

    return 0;
}

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

int A[5];
int main()
{
    for (int i = 0; i < 5; i++)
        scanf("%d", &A[i]);
    A[2] /= 2, A[3] /= 7, A[4] /= 4;
    printf("%d\n", *min_element(A, A + 5));
    return 0;
}

#include<stdio.h>

inline int min(int a,int b) {return a<b?a:b;}

int minn=19260817;

int main() {
	int a;
	scanf("%d",&a);minn=a;
	scanf("%d",&a);minn=min(a,minn);
	scanf("%d",&a);minn=min(a/2,minn);
	scanf("%d",&a);minn=min(a/7,minn);
	scanf("%d",&a);minn=min(a/4,minn);
	printf("%d\n",minn);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,s;
int main()
{
 //freopen(".in","r",stdin);
 //freopen(".out","w",stdout);
 cin>>a>>b>>c>>d>>e;
 for(; ;)
 {
  if(a>=1 && b>=1 && c>=2 && d>=7 && e>=4)
  {
   s++;
   a-=1,b-=1,c-=2,d-=7,e-=4;
  }
  else break;
 }
 cout<<s;
 return 0;
}

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int a[6];
int main ()
{
	for(int i=1;i<=5;i++)
	{
		cin>>a[i];
	}
	a[3]/=2;
	a[4]/=7;
	a[5]/=4;
	sort(a+1,a+5+1);
	cout<<a[1];
}

#include<bits/stdc++.h>
using namespace std;
int a1,a2,a3,a4,a5;
int main(){
	cin>>a1>>a2>>a3>>a4>>a5;
	cout<<min(a1,min(a2,min(a3/2,min(a4/7,a5/4))));
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main() {
  int a,b,c,d,e;
  cin>>a>>b>>c>>d>>e;
  int ans=min(a,min(b,min(c/2,min(d/7,e/4))));
  cout<<ans<<endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
long long a,b,c,d,e,s;
int main()
{
    cin>>a>>b>>c>>d>>e;
    while (a>=1 && b>=1 && c>=2 && d>=7 && e>=4)
    {
        s++;
        a-=1;
        b-=1;
        c-=2;
        d-=7;
        e-=4;
    }
    cout<<s;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	c/=2;
	d/=7;
	e/=4;
	int ans;
	ans=min(a,b);
	ans=min(ans,c);
	ans=min(ans,d);
	ans=min(ans,e);
	cout<<ans;
	return 0;
}

#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    int arrSource[5],i;
    for (i = 0; i <= 4; ++i){
        cin >> arrSource[i];
    }
    arrSource[2] /= 2;
    arrSource[3] /= 7;
    arrSource[4] /= 4;
    cout << *min_element(arrSource, arrSource + 5);
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <vector>
#include <bitset>
#include <string>
#include <ctype.h>
#include <stdio.h>
#include <sstream>
#include <fstream>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <limits.h>
using namespace std;

#define DBG 0
#define MAX 1e9
#define mp make_pair
#define pb push_back
#define bg puts("bug")
#define cl(A) A.clear()
#define pii pair<int,int>
#define edg pair<pii,pii>
#define sz(A) int(A.size())
#define rsz(A,B) A.resize(B)
#define ALL(A) A.begin(),A.end()
#define mem(A,B) memset(A,B,sizeof A)
#define rep(A,B,C) for(int A=B;A<C;A++)
#define rep_(A,B,C) for(int A=B;A>=C;A--)
#define print(A) printf("%s = %d\n",#A,A)

typedef long long int lli;
typedef set<pii> ::iterator itS;
typedef map<pii,int> ::iterator itM;

int dx[] = {0,0,1,-1,1,-1,1,-1}  , dy[] = {1,-1,0,0,1,-1,-1,1};

int geti(){
    int y = 0, s = 1;
    char c = getchar();
    while ( !isdigit(c) && c!='-' ) c = getchar();
    if ( c == '-' ) s = -1 , c = getchar();
    while ( isdigit(c) ) y = y * 10 + ( c - '0' ) , c = getchar();
    return s * y;
}

int main(){

    // freopen("read.txt","r",stdin);
    // freopen("print.txt","w",stdout);

    int x;
    int y[]={1,1,2,7,4};
    int a=1e9;
    for(int i=0;i<5;++i){
        cin>>x;
        a=min(a,x/y[i]);

    }
    cout<<a<<endl;

    return 0;
}

#include <iostream>
#include <string>

using namespace std;

int main()
{
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    cout << min( a, min( b, min( c / 2, min( d / 7, e / 4 ) ) ) );
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
int min(int a,int b){
	return a<b?a:b;
}
using namespace std;
int main() {
	int a,b,c,d,e;
	cin >> a >> b >> c >> d >> e ;
	cout << min(a,min(b,min(c/2,min(d/7,e/4))));
	return 0;
}

#include <iostream>

using namespace std;

const double divisor[] = { 1.0F, 1.0F, 2.0F, 7.0F, 4.0F };
double a[5] = { 0 };

int main() {
	int ans = 0x7fffffff;
	for(int i = 0; i < 5; i++) {
		cin >> a[i];
		if(ans > (a[i] / divisor[i])) {
			ans = a[i] / divisor[i];
		}
	}
	cout << ans;
	return 0;
}

#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <iomanip>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <string> vs;
typedef istringstream iss;
typedef ostringstream oss;

int main(){
	#ifndef ONLINE_JUDGE
 		freopen("vd.inp", "r", stdin);
		freopen("vd.out", "w", stdout);
	#endif
	ios_base::sync_with_stdio(false);
	stringstream ss;
	string s;
	int n, i = 0;
	int a[10000];
	for(int i = 0; i < 5; i++){
		cin >> a[i];
	}
	cout << min(min(a[0],a[1]), min(a[2]/2, min(a[3]/7, a[4]/4)));
	return 0;
}

//In the name of god

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;

	cout << min(a, min(b, min((c / 2), min((d / 7), (e / 4)))));

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a[5],i;
    for (i=0;i<=4;i++)
        cin>>a[i];
    a[2]/=2;
    a[3]/=7;
    a[4]/=4;
    cout<<*min_element(a,a+5);
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
     int t=min(a,min(b,min(c/2,min(d/7,e/4))));
    cout << t << endl;
    return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
    int xs,ws,cg,q,f;
    while(~scanf("%d %d %d %d %d",&xs,&ws,&cg,&q,&f))
    {
        int sum=0;
        while(xs>=1&&ws>=1&&cg>=2&&q>=7&&f>=4)
        {
            sum++;
            xs-=1;
            ws-=1;
            cg-=2;
            q-=7;
            f-=4;
            //printf("%d %d %d %d %d\n",xs,ws,cg,q,f);
        }
        printf("%d\n",sum);
    }
}

#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;

int element[5];

int main()
{
	scanf("%d %d %d %d %d",&element[0],&element[1],&element[2],&element[3],&element[4]);
	element[2]/=2;element[3]/=7;element[4]/=4;
	sort(element,element+5);
	printf("%d",element[0]);
	return 0;
}

#include <iostream>
#include <algorithm>

int nums[5] = { 0 };

int main()
{
	std::cin >> nums[0] >> nums[1] >> nums[2] >> nums[3] >> nums[4];
	nums[2] /= 2; nums[3] /= 7; nums[4] /= 4;
	int* min = std::min_element(nums, nums + 5);
	std::cout << *min << std::endl;
	return 0;
}

#include<cstdio>
using namespace std;

int a,b,c,d,e,ans;

int main(){
	scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
	while(++ans){
		bool ok=0;
		if(a<1) ok=1;
		a--;
		if(b<1) ok=1;
		b--;
		if(c<2) ok=1;
		c-=2;
		if(d<7) ok=1;
		d-=7;
		if(e<4) ok=1;
		e-=4;
		if(ok){
			printf("%d",ans-1);
			return 0;
		}
	}
}

#include <cstdio>
#include <iostream>
using namespace std;

int main() {
    int c[] = {1, 1, 2, 7, 4};
    int x, ret = 1e9;
    for(int i = 0; i < 5; i++) {
        cin >> x;
        ret = min(ret, x/c[i]);
    }
    cout << ret << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e;
int main()
{
    cin>>a>>b>>c>>d>>e;
    cout<<min(a,min(b,min(c/2,min(d/7,e/4))));
    return 0;
}

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

const long long c[5]={1,1,2,7,4};
long long ans=0x7fffffffffffffff,a[5];

int main()
{
    for (int i=0; i<5; i++)
    	cin>>a[i];
    for (int i=0; i<5; i++)
    	ans=min(ans,a[i]/c[i]);
    cout<<ans;
    return 0;
}

#pragma warning(disable:4996)
#include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#define maxn 30
#define eps 1e-4
using namespace std;

int main()
{
	int a[5] = { 1, 1, 2, 7, 4 };
	int b[5];
	while (cin >> b[0] >> b[1] >> b[2] >> b[3] >> b[4]){
		int ans = 100000000;
		for (int i = 0; i < 5; i++) ans = min(ans,b[i] / a[i]);
		cout << ans << endl;
	}
	return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <limits>
#include <cstring>
#include <string>
using namespace std;

#define pairii pair<int, int>
#define llong long long
#define pb push_back
#define sortall(x) sort((x).begin(), (x).end())
#define INFI  numeric_limits<int>::max()
#define INFL  numeric_limits<long>::max()
#define INFLL numeric_limits<llong>::max()
#define INFD  numeric_limits<double>::max()
#define MOD 1000000007
#define PI 3.1415926535897932384626433832795028841971693993751058209749445923
#define FOR(i,s,n) for (int (i) = (s); (i) < (n); (i)++)
#define FORZ(i,n) FOR((i),0,(n))

//#define TESTFILE

int main() {
#ifdef TESTFILE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif

    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    vector<int> v;
    v.pb(a);
    v.pb(b);
    v.pb(c/2);
    v.pb(d/7);
    v.pb(e/4);
    sortall(v);
    cout << v[0] << endl;

    return 0;
}

#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int a[10];
int main()
{
	cin>>a[1]>>a[2]>>a[3]>>a[4]>>a[5];
	a[3]/=2;
	a[4]/=7;
	a[5]/=4;
	sort(a+1,a+6);
	printf("%d",a[1]);
 	return 0;
}

#include "iostream"
#include "stdlib.h"
#include "math.h"

using namespace std;

int main()
{
	int a,b,c,d,e,answ=0;
	cin>>a>>b>>c>>d>>e;
	while(1)
	{

	a=a-1;
	b=b-1;
	c=c-2;
	d=d-7;
	e=e-4;
	if(a>=0 && b>=0 && c>=0 && d>=0 && e>=0)
		answ++;
	if(a<0 && b<0 && c<0 && d<0 && e<0)
		 break;
	}
	cout<<answ;
}

#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
    int s[5],d[5]={1,1,2,7,4},ans=100;
    for(int i=0;i<5;i++)
    {
        scanf("%d",&s[i]);
        ans=min(ans,s[i]/d[i]);
    }
    printf("%d\n",ans);
}

/*
ID: wuqi9395@126.com
PROG:
LANG: C++
*/
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cmath>
#include<cstdio>
#include<vector>
#include<string>
#include<fstream>
#include<cstring>
#include<ctype.h>
#include<iostream>
#include<algorithm>
#define maxn 1000
#define INF (1<<30)
#define PI acos(-1.0)
#define mem(a, b) memset(a, b, sizeof(a))
#define For(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int main ()
{
    int a, b, c, d, e;
    cin>>a>>b>>c>>d>>e;
    int s = 0;
    s = min(a, b);
    s = min(s, c / 2);
    s = min(s, d / 7);
    s = min(s, e / 4);
    cout<<s<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e;// 1 1 2 7 4
int main(){
    scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
    cout<<min(a,min(b,min(c/2,min(d/7,e/4))));
    return 0;
}

#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
    int a,b,c,d,e,s=0;
    cin>>a>>b>>c>>d>>e;
    while(a>=1&&b>=1&&c>=2&&d>=7&&e>=4)
    {
        a--;
        b--;
        c-=2;
        d-=7;
        e-=4;
        s++;
    }
    cout<<s;
    return 0;
}

#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int a[5],b[5]={1,1,2,7,4};
int main(){
	for(int i=0;i<5;i++){
		cin>>a[i];
		a[i]/=b[i];
	}
	sort(a,a+5);
	cout<<a[0];
	return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;

const int B[5] = {1, 1, 2, 7, 4};

int f[5];

int main() {
    int ans = 0, pos = 0, x;
    while (cin >> x) {
        f[pos] += x;
        pos = (pos + 1) % 5;
    }
    ans = 1000000;
    for (int i = 0; i < 5; ++i) ans = min(ans, f[i] / B[i]);
    cout << ans << endl;
    return 0;
}

#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <ctime>
#include <functional>

using namespace std;

#define CLR(a,x) memset(a,x,sizeof a)
#define LL long long
#define ALL(v) v.begin(),v.end()
#define FR(i,n) for(LL i=0;i<(LL)n;i++)
#define FAB(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define FBA(i,b,a) for(LL i=(LL)b;i>=(LL)a;i--)
#define IIN(x) scanf("%d",&x)
#define IIN2(x,y) scanf("%d%d",&x,&y)
#define LIN(x) scanf("%I64d",&x)
#define LIN2(x,y) scanf("%I64d%I64d",&x,&y)
#define EXIT(n) {cout<<n<<endl;return 0;}
#define PII pair<int,int>
#define PIP pair<int,PII>
#define PLL pair<LL,LL>
#define PDD pair<double,double>
#define PIS pair<int,string>
#define PSI pair<string,int>
#define PI 3.141592653589793238
#define VI vector<int>
#define VLL vector<LL>
#define VS vector<string>
#define SI set<int>
#define SLL set<LL>
#define SIP set<PIP>
#define SS set<string>
#define MII map<int,int>
#define MLL map<LL,LL>
#define MSI map<string,int>
#define MSL map<string,LL>
#define MIS map<int,string>
#define INF 100000000000000000
#define MOD 1000000007
#define MAX 1000+10

int main()
{
    //freopen("in.txt","r",stdin);

    int a,b,c,d,e; cin>>a>>b>>c>>d>>e;

    cout<<min(min(min(a,b),e/4),min(c/2,d/7))<<endl;

    return 0;
}

#define _CRT_SECURE_NO_WARNINGS

#pragma comment (linker, "/STACK:1000000000")

#include <iostream>
#include <ctime>
#include <string>
#include <vector>
#include <set>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <memory>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <list>
#include <complex>
#include <hash_map>
#include <hash_set>

using namespace std;

#define pb push_back
#define pob pop_back
#define itr iterator
#define rs resize
#define as assign
#define fs first
#define sc second
#define lwb lower_bound
#define upb upper_bound
#define mp make_pair
#define sz(a) (int)a.size()
#define FOR(i, n) for (int i = 0; i < n; ++i)
#define FOD(i, n) for (int i = n - 1; i >= 0; --i)

typedef long long ll;
typedef unsigned long long ull;
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef vector <ll> vl;
typedef vector <vl> vvl;
typedef vector <bool> vb;
typedef vector <vb> vvb;
typedef vector <string> vs;
typedef vector <vs> vvs;
typedef vector <char> vc;
typedef vector <vc> vvc;
typedef vector <vvc> vvvc;
typedef vector <vvi> vvvi;
typedef vector <vvvi> vvvvi;
typedef vector <vvl> vvvl;
typedef vector <vvvl> vvvvl;
typedef vector <vvb> vvvb;
typedef double db;
typedef long double ldb;
typedef vector <db> vdb;
typedef vector <vdb> vvdb;
typedef vector <vvdb> vvvdb;
typedef vector <ldb> vldb;
typedef pair <int, int> ii;
typedef pair <int, char> ic;
typedef pair <ll, ll> lll;
typedef pair <int, ll> il;
typedef pair <ll, int> li;
typedef vector <ii> vii;
typedef vector <ic> vic;
typedef vector <vic> vvic;
typedef vector <vii> vvii;
typedef vector <lll> vll;
typedef vector <vll> vvll;
typedef pair <ll, int> li;
typedef pair <ll, ll> lll;
typedef pair <int, ll> il;
typedef set <int> si;
typedef set <ll> sl;
typedef set <li> sli;
typedef set <il> sil;
typedef set <lll> sll;
typedef set <ii> sii;
typedef set <pair <int, bool> > sib;
typedef vector <si> vsi;
typedef vector <sii> vsii;
typedef map <int, int> mii;
typedef map <string, int> msi;
typedef map <string, char> msc;
typedef map <char, int> mci;
typedef queue <int> qi;
typedef deque <int> di;
typedef stack <int> sti;

const int inf = (int)1e9 + 7;
const ldb eps = 1e-6;
const int M = 100;
const int N = 100005;
const int K = 102;

int main()
{
    ll a[100005];
    for (int i = 0; scanf("%I64d", &a[i]) != EOF; ++i);
    printf("%I64d", min(a[0], min(a[1], min(a[2] / 2, min(a[3] / 7, a[4] / 4)))));
    return 0;
}

#include<iostream>
using namespace std;
long a,b,c,d,e;
int main()
{
    cin>>a>>b>>c>>d>>e;
    cout<<min(min(min(a,b),min(c/2,d/7)),e/4)<<endl;
}

#include <bits/stdc++.h>
using namespace std;
int a,b,c,d,e;
int main ()
{
	cin>>a>>b>>c>>d>>e;
	cout<<min(a,min(b,min(c/2,min(d/7,e/4))));
    return 0;
}

#include <stdio.h>
const int b[] = {1, 1, 2, 7, 4};

int main() {
    int a[5];
    int ans = 111111111;
    for (int i = 0; i < 5; i++) {
        scanf("%d", &a[i]);
        int x = a[i] / b[i];
        if (x < ans) {
            ans = x;
        }
    }
    printf("%d\n", ans);
    return 0;
}

//
// ^|feennohmo_taI_g__d
//
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <deque>
#include <set>
#include <vector>
#include <map>
#include <string>
#include <cstring>
#include <iomanip>
#include <cstdio>
#include <fstream>
#include <sstream>

#define For(i,a,n) for(int i =a ; i < n ; ++i )
#define all(x) (x).begin(),(x).end()
#define n(x) (int)(x).size()
#define pb(x) push_back(x)
#define fr first
#define sc second

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

int smax = 9999;
int val[5]={1,1,2,7,4};
int a[5];

int main()
{
	ios::sync_with_stdio(false);
	For(i,0,5){
		cin >> a[i];
		smax = min(a[i]/val[i],smax);
	}
	cout << smax << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e;
int main()
{
	cin>>a>>b>>c>>d>>e;
    cout<<min(a,min(b,min(c/2,min(d/7,e/4))));
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e;
int main(){
    cin>>a>>b>>c>>d>>e;
    cout<<min(a,min(b,min(c/2,min(d/7,e/4))));
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
   	long long min=1000000000,m;
   	int a[5]={1,1,2,7,4};
   	for(int i=0;i<5;i++)
   	{
	   cin>>m;
	   m/=a[i];
	   if(m<min)
			min=m;
	}
	cout<<min;
	return 0;
}

#include <iostream>
using namespace std;

int main(){

	int ans=100;
	int b[10]={1,1,2,7,4};
	for(int i=0; i<5; i++){
		int x=0;	cin >>x;
		ans=min(ans, x/b[i]);
	}
	cout <<ans <<endl;

	return 0;
}

#define _CRT_SECURE_NO_WARNINGS

#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <tuple>
#include <cassert>
#include <cstring>

#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define rp(i,s,n) for((i)=(s);(i)<(n);(i)++)
#define fore(x,Z) for(__typeof((Z).begin()) x=(Z).begin();x!=(Z).end();++x)
#define repe(it,a) for(auto (it) = (a).begin();(it)!=(a).end();++(it))

#define ll long long
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define X first
#define Y second
#define ALL(a) (a).begin(),(a).end()
#define SZ(a) (a).size()
#define LEN(s) (s).length()
#define uset unordered_set
#define umap unordered_map
#define IT iterator

#pragma comment(linker,"/STACK:100000000")

using namespace std;

#define NUMBERS(a,b) { int _i_; vector<int> _A_(((b))-(a)); rep(_i_,_A_.size()) _A_[_i_] =_i_+(a); out(_A_);}

template <class T> void out(map<char,T> & a,string s="(%3c ->%3d)"){repe(it,a) printf(s.c_str(),it->X,it->Y);printf("\n");}

template <class T>void out(vector<T> & a,string s="%3d "){int i,n=a.size();rep(i,n) printf(s.c_str(),a[i]);printf("\n");}

template <class T>void out(T * a,int n,string s="%3d "){int i;rep(i,n) printf(s.c_str(),a[i]);printf("\n");}

ll i,j,N,M,n,m,k,p;

int MainSolve(string args = ""){
    cout << args;
    //write code here
    //int a[] = { 2, 4, 6, 8, 10 };
    int z;
    int dv[] = { 1, 1, 2, 7, 4 };
    int mn = 101;
    rep(i, 5){
        cin >> z;
        mn = min(mn, z / dv[i]);
        }
    cout << mn << endl;

    return 0;
}

string ReadAllLines(char * fileName){
    string s = "";
    const int NMAX = 1000;
    char buf[NMAX]; buf[0] = 0;
    FILE *f = fopen(fileName, "r");
    while (fgets(buf, NMAX, f))
        s = s + string(buf);
    return string(s.begin(), find_if(s.rbegin(), s.rend(), [](char c){return c != '\n'&& c != '\r' && c != '\t' && c != ' '; }).base());
}
int main() {

#ifdef ONLINE_JUDGE
    MainSolve();
#endif

#ifndef ONLINE_JUDGE
    int _flag_ = 0;
#endif

#ifndef ONLINE_JUDGE
    freopen("C:/Olimp2014/409_CF_virtual/C/A/input1.txt","r",stdin);
    MainSolve("Case 1 :\n");
#endif

#ifndef ONLINE_JUDGE
    freopen("C:/Olimp2014/409_CF_virtual/C/A/input1.txt","r",stdin);
    freopen("C:/Olimp2014/409_CF_virtual/C/A/output1.out","w",stdout);
    MainSolve();
if ((ReadAllLines("C:/Olimp2014/409_CF_virtual/C/A/output1.out")) == ReadAllLines("C:/Olimp2014/409_CF_virtual/C/A/output1.txt"))_flag_++;
#endif

#ifndef ONLINE_JUDGE
    if (_flag_ == 1) cerr << "Pretests Good!" << endl;
    else cerr << "Pretests failed!" << endl;
#endif

return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d,e,ans=0;
	cin>>a>>b>>c>>d>>e;
	while(a>0&&b>0&&c>1&&d>6&&e>3)
	{
		ans++;
		a-=1;
		b-=1;
		c-=2;
		d-=7;
		e-=4;
	}
	cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
struct point {int x;int y;};
bool operator <(const point &a,const point &b){return (a.x<b.x);}
int compare (const void * a, const void * b){return ( *(int*)a - *(int*)b );}
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,b) REP(i,0,b)
#define si(n) scanf("%d",&n)
//#define sort(arrr,n) qsort(arrr,n,sizeof(int),compare)
int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
int main()
{
    int a,b,c,d,e,cnt=0;
    scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
    while((a-1>=0)  && (b-1>=0) && (c-2>=0) && (d-7>=0) &&  (e-4>=0))
    {
        a--;b--;c-=2;d-=7;e-=4;
        cnt++;
    }
    cout << cnt << endl;
	return 0;
}

#include<iostream>
using namespace std;
int main() {
  int a,b,c,d,e,la=0;
  cin>>a>>b>>c>>d>>e;
  while(a>=1&&b>=1&&c>=2&&d>=7&&e>=4){
    la++;
    a-=1;
    b-=1;
    c-=2;
    d-=7;
    e-=4;
  }
  cout<<la<<endl;
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	c/=2;
	d/=7;
	e/=4;
	cout<<min(a,min(b,min(c,min(d,e))))<<endl;
 	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e;// 1 1 2 7 4
int main(){
    scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
    cout<<min(a,min(b,min(c/2,min(d/7,e/4))));
    return 0;
}

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <stdio.h>
#include <cstring>
#include <cmath>
//#include <omp.h>
#include <stdlib.h>
#include <fstream>
using namespace std;

int main()
{
	int eng[5];
	int res[5]= {0};
	for(int i = 0; i < 5; i++)
		cin>>eng[i];
	res[0] = eng[0];
	res[1] = eng[1];
	res[2] = eng[2]/2;
	res[3] = eng[3]/7;
	res[4] = eng[4]/4;
	int minimum = 1e6;
	for(int i = 0; i < 5; i++)
		if(minimum > res[i])
			minimum = res[i];

	cout<<minimum;

	/*char first[21];
	char second[21];
	cin>>first>>second;
	int first8 = 0;
	int second8 = 0;
	for(int i = 0; i < strlen(first); i++)
	{
		if(first[i] == '8')
			first8++;
	}
	for(int i = 0; i < strlen(second); i++)
	{
		if(second[i] == '8')
			second8++;
	}
	if(first[strlen(first)-1] == '<' && second[strlen(second)-1] == '<')
	{
		if(first8 > second8)
			cout<<"TEAM 1 WINS";
		else if (first8 < second8)
			cout<<"TEAM 2 WINS";
		else
			cout<<"TIE";
	}
	else if(first[strlen(first)-1] == '<' )
	{
		cout<<"TEAM 1 WINS";
	}
	else if(second[strlen(second)-1] == '<' )
	{
		cout<<"TEAM 2 WINS";
	}
	else
			cout<<"TIE";
			*/
	return 0;

}

#include <cstdio>
int ret, akt;
#define MIN(a,b) ((a<b)?(a):(b))
int main () {
	scanf ("%d", &akt); ret = akt;
	scanf ("%d", &akt); ret = MIN(ret,akt);
	scanf ("%d", &akt); ret = MIN(ret,akt/2);
	scanf ("%d", &akt); ret = MIN(ret,akt/7);
	scanf ("%d", &akt); ret = MIN(ret,akt/4);
	printf ("%d\n", ret);
}

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string.h>
#include <bitset>
#include <set>
#include <map>
#include <stack>
#include <cstdio>
#include <sstream>
using namespace std;

#define REP(i,n)  for(int i=0;i<(int)(n);++i)
#define FOR(i,b,n)  for(int i=b;i<(n);++i)
#define ROF(i,e,b)  for(int i=(e);i>=b;--i)
#define ALL(c) (c).begin(),(c).end()
#define SS size()
#define SZ(c) (int)((c).size())
#define CLR(a,v) memset((a),(v), sizeof a)				//CLR(W[0]) for W[50][50] is OK.
#define ZERO(a) memset((a),0, sizeof a)
#define PB push_back
#define MP make_pair
#define ST first
#define ND second
#define BIT(i) bitset<31>((i)).to_string().c_str()

template <typename T> void PrintContainer(T& a, int n = -1) {
  if (n==-1) n=a.size();
  cout << "{";
  int i = 0;
  for(auto it : a) {
    cout << (it) << ", ";
    if (++i==n) break;
  }
  cout << "}\n";}

typedef long long ll;
typedef uint8_t byte;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pii;
typedef set<int> si;

int main() {
	int need[]{1,1,2,7,4};
	int k, mx = 1000;

	REP(i,5) {
		cin >> k;
		mx = min(mx, k / need[i]);
	}
	cout << mx << endl;
}

#include<iostream>
using namespace std;
int main(void){
	int a,b,c,d,e,min=0;
	cin>>a>>b>>c>>d>>e;
	if(a/1>min)
	    min=a/1;
	if(b/1<min)
	    min=b/1;
	if(c/2<min)
	    min=c/2;
	if(d/7<min)
	    min=d/7;
	if(e/4<min)
	    min=e/4;
	cout<<min;
	return 0;
}

#include <bits/stdc++.h>
#define lo long long int
using namespace std;
int main()
{
    lo a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	cout<<min(a,min(b,(min(c/2,min(d/7,e/4)))));
  	return 0;
}

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

int min2(int a, int b)
{
	if ( a < b ) return a;
	else		 return b;
}

int min5(int a, int b, int c, int d, int e)
{
	return min2( a, min2( b, min2( c, min2( d, e))));
}

int main()
{
	int a, b, c, d, e;
	while ( cin >> a >> b >> c >> d >> e )
	{
		cout << min5( a, b, c/2, d/7, e/4) << endl;
	}
}

#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pi acos(-1.0)
#define EPS 1e-9
#define mem(n,x) memset(n,x,sizeof(n))
typedef long long ll;

using namespace std;

int main()
{
	int a,b,c,d,e,ans=0;
	cin>>a>>b>>c>>d>>e;
	while(1){
		if(a-1<0 || b-1<0 || c-2<0 || d-7<0 || e-4<0)break;
		a--;b--;c-=2;d-=7;e-=4;
		ans++;
	}
	cout<<ans<<"\n";
	return 0;
}

#include <algorithm>
#include <iostream>

using namespace std;

int main()
{
	cin.sync_with_stdio(0);
	cin.tie(0);

	int a[5];
	for (int i = 0; i < 5; i++) cin >> a[i];
	a[2] /= 2, a[3] /= 7, a[4] /= 4;

	cout << *min_element(a, a + 5) << '\n';
	return 0;
}

#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <math.h>
#include <hash_set>
#include <algorithm>
#include <map>
#include <set>
#include <conio.h>
#include <stack>

#define _USE_MATH_DEFINES
#define TASK "secure"

using namespace std;

int main(){
    //freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
    int a,b,c,d,e;
    vector<int>vec(5);
    for(int i=0; i<5; ++i){
        cin >>vec[i];
    }
   // sort(vec.begin(),vec.end());
    a=vec[0];
    b=vec[1];
    c=vec[2];
    d=vec[3];
    e=vec[4];
    int res = a;
    res = min(a,b);
    res = min(res,c/2);
    res = min(res,d/7);
    res = min(res,e/4);
    cout << res;

    return 0;
}

#include <iostream>

using namespace std;

int main(){
	int A, B, C, D, E;
	cin>>A>>B>>C>>D>>E;
	int mmax=min(A, min(B, min(C/2, min(D/7, E/4))));
	cout<<mmax<<endl;
}

#include <iostream>
#include <stdio.h>
#include <vector>
#include <cmath>
#include <map>
#include <string>
#include <algorithm>
using namespace std;

char getch;
int main()
{
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    int a1, b1, c1, d1, e1;
    a1 = a / 1;
    b1 = b / 1;
    c1 = c / 2;
    d1 = d / 7;
    e1 = e / 4;
    cout << min(a1, min(b1, min(c1, min(d1, e1))));

    return 0;
}

#include <iostream>
#include <sstream>
#include <bitset>
#include <cstdio>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <numeric>
#include <list>
#define FOR(i,A) for(typeof (A).begin() i = (A).begin() ; i != (A).end() ; i++)
#define mp make_pair
#define debug( x ) cout << #x << " = " << x << endl
#define clr(v,x) memset( v, x , sizeof v )
#define all(x) (x).begin() , (x).end()
#define rall(x) (x).rbegin() , (x).rend()
#define f(i,a,b) for(int i = a ; i < b ; i++)
#define fd(i,a,b) for(int i = a ; i >= b ; i--)
#define PI acos( -1.0 )
#define EPS 1E-9
#define TAM 100010

using namespace std;

typedef pair<int,int> ii ;
typedef long long ll ;
typedef long double ld ;
typedef pair<int,ii> pii ;

int main(){

    int a , b , c , d , e ;
    while( scanf("%d%d%d%d%d" , &a , &b , &c , &d , &e ) == 5 ){
        int mx = min( a / 1 , min( b / 1 , min( c / 2 , min( d / 7 , e / 4 ) ) ) ) ;
        printf("%d\n" , mx ) ;
    }
    return 0 ;
}

#include<iostream>
using namespace std;

main()
{
    int a,b,c,d,e;
    cin >> a >> b >> c >> d >> e;
    cout << min(a,min(b,min(c/2,min(d/7,e/4))));
}

#include <bits/stdc++.h>
#if !defined(ID)
#define ID(x)
#endif
using namespace std;
void E(){}template<class A,class...B>void E(A _,B...$){ID(cerr<<' '<<_;E($...);)}
#define E($...) E(#$,'=',$,'\n')

vector<int> aa = {1, 1, 2, 7, 4};
vector<int> a;

int main() {
	ios_base::sync_with_stdio(false);
	int d;
	while (cin >> d) a.push_back(d);
	assert(a.size() == 5);

	for (int i = 0; i < 5; ++i) a[i] /= aa[i];
	cout << *min_element(begin(a), end(a));

	return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int x,ans=0x3f3f3f;
int main()
{
	cin>>x;
	ans=min(ans,x);
	cin>>x;
	ans=min(ans,x);
	cin>>x;
	ans=min(ans,x/2);
	cin>>x;
	ans=min(ans,x/7);
	cin>>x;
	ans=min(ans,x/4);
	cout<<ans;
	return 0;
}

#include<iostream>
using namespace std;
int main(){int a,b,c,d,e;cin>>a>>b>>c>>d>>e;cout<<min(a,min(b,min(c/2,min(d/7,e/4))));}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	c/=2;
	d/=7;
	e/=4;
	cout<<min(a,(min(b,min(c,min(d,e)))));
	return 0;
}

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    int n = 5, ans = 1e9;
    for (int i = 0; i < 5; i++)
    {
        int a;
        cin >> a;
        if (i < 2)
            ans = min (ans, a);
        else if (i == 2)
            ans = min (ans, a / 2);
        else if (i == 3)
            ans = min(ans, a / 7);
        else
            ans = min(ans, a / 4);
    }
    cout << ans << endl;
    return 0;
}

#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int a[10],ans=105;
	for(int i=0;i<5;i++){
		scanf("%d",&a[i]);
		if(i==1||i==0)
			ans=min(ans,a[i]);
		else if(i==2)
			ans=min(ans,a[i]/2);
		else if(i==3)
			ans=min(ans,a[i]/7);
		else
			ans=min(ans,a[i]/4);
	}
	printf("%d",ans);
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>

#include <cstdio>
#include <ctime>
#include <cmath>
#include <cstring>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
#ifdef PC
    freopen("input.txt", "r", stdin);
#endif

    int m[] = { 1, 1, 2, 7, 4 };
    int v, w, o = 100;

    for (v = 0; v < 5; v++)
    {
        cin >> w;
        o = min(o, w / m[v]);
    }
    cout << o << endl;

    return 0;
}

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

int main(){
int arr[5] ;
int i ;
for ( i = 0 ; i <5 ; i++)
cin >> arr[i] ;
//sort ( arr , arr+5);
arr[2] /= 2 ;
arr[3] /= 7 ;
arr[4] /= 4 ;
int mini = 9999999 ;
for ( i = 0 ; i  < 5 ; i++)
mini = min ( mini , arr[i]);
cout << mini ;
return 0 ;

}

#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MEM(a,b) memset((a),(b),sizeof(a))

int main()
{
	//freopen("input.txt", "r", stdin);
	int a[5] = { 1, 1, 2, 7, 4 };
	int  n = 5;
	int ans = 100;
	for (int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		ans = MIN(ans, x / a[i]);
	}
	cout << ans << endl;

	return 0;
}

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string.h>
#include<climits>
#include<vector>
#include<stack>
#include<set>
#include<math.h>
using namespace std;
#define FOR(i,a,b) for(i=a;i<=b;i++)
#define sint(i) scanf("%d",&i)
#define ss(s) scanf("%s",s)
#define pii pair<int,int>
#define mp(i,j) make_pair(i,j)
#define ll long long
#define MAX 1000000000
#define MOD 1000000007
#define vi vector<int>
#define vvi vector < vi >
#define pb(i) push_back(i);
#define tr(v,it) for(it=v.begin();it!=v.end();it++)
int main()
{
    int i;
    int a[6];
    int ans[6]={0};
    int r[]={0,1,1,2,7,4};
    int final1=INT_MAX;
    FOR(i,1,5)
    {
        cin>>a[i];
        ans[i]=a[i]/r[i];
        final1=min(final1,ans[i]);
    }
    cout<<final1;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    cout<<min(a,min(b,min(c/2,min(d/7,e/4))));
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <set>
#include <map>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <cstdio>
#include <vector>
#include <cctype>
#include <climits>
#include <sstream>
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

#define fast ios_base::sync_with_stdio(false)

#define si(a) cin>>a
#define si2(a,b) cin>>a>>b
#define si3(a,b,c) cin>>a>>b>>c

#define read freopen("in.in","r",stdin)
#define write freopen("out.in","w",stdout)

#define rep(i,a,b) for(int i=a;i<b;++i)
#define rep_(i,a,b) for(int i=a;i>=b;--i)
#define wh(t) while(t--)

#define Set(a,b) memset(a,b,sizeof a)
#define Vset(a,b,c) a.resize(b,c)
#define clr(a) a.clear()
#define Sz(a) a.size()
#define Arrsz(a) sizeof a / sizeof a[0]
#define All(a) (a.begin(),a.end())
#define mp make_pair

#define Bug puts("Bug")
#define Nl puts("");
#define Vi vector
#define pr pair
#define N 1001

#define isnum(a) (a>=48 && a<=57)
#define isSchar(a) (a>='a' && a<='z')
#define isCchar(a) (a>='A' && a<='Z')

typedef long long lli;
typedef unsigned long long llu;
typedef Vi<int> vi;
typedef pr<int, int> pii;
typedef pr<pii, int> piii;
typedef map<int, int>::iterator Mit;
typedef set<char>::iterator Sit;

int gcd(int a, int b){ return (a == 0) ? b : (b == 0) ? a : gcd(b, a%b); }
int str_div(char *s, int n){ int y = 0, ln = strlen(s); rep(i, 0, ln)y = (y * 10 + (s[i] - 48)) % n; return y; }
int get(){
    int y = 0, s = 1, i = 10;
    char c = getchar();
    while (!isnum(c)){
        if (c == '-')s = -1; c = getchar();
    }
    while (isnum(c)){ y = y * 10 + (c - '0'), c = getchar(); }
    if (c != '.')return y;
    c = getchar();
    while (isnum(c))y = y + (c - '0') / i, i *= 10, c = getchar();
    return y*s;
}

int dx[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] = { 0, 0, 1, -1, -1, 1, -1, 1 };

int main()
{
    fast;
    int i=0,n;
    vector<int>arr;
    while (si(n))arr.push_back(n);
    cout << arr[0]-1;
}

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <string>
#include <memory.h>
#include <map>
#define _USE_MATH_DEFINES
#include <math.h>
#include <list>
#include <fstream>
#include <time.h>
#include <iomanip>
#include <queue>
#include <stack>
#include <complex>
#include <limits.h>
#include <cassert>
#include <chrono>
#include <regex>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <valarray>

using namespace std;
using namespace std::chrono;

typedef long long ll;

const int N = 16005;
const int K = 605;
const ll InfL = 1000000000000000000LL;
const int MOD = 1000000007;

//#define ONLINE_JUDGE
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    bool fl = true;
    for (int i = 0; i < 5; ++i) {
        int a;
        cin >> a;
        fl &= a > 0;
    }
    cout << fl << endl;
    return 0;
}

#include<iostream>

using namespace std;

int tab[] = {1,0,0,0,0,1,0,1,1,1,0,0,1,1,0};

int main()
{
  int n;
  cin >> n;
  cout << tab[n-1];
  return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;
long long int a,b,c,d,e,ans,f,g,h,i,j;
int main()
{
	cin>>a>>b>>c>>d>>e;
	f=c/2;
	g=d/7;
	j=e/4;
	ans=min(a,min(b,min(f,min(g,e))));
	cout<<ans<<endl;
	return 0;
}

#include <iostream>
#include <fstream>
#include <algorithm>
#include <cstring>
#include <cmath>

using namespace std;

ifstream fin("date2.in");
ofstream fout("date2.out");

#define fin cin
#define fout cout

int main(){

    int a, b, c, d, e;

    fin >> a >> b >> c >> d >> e;

    fout << (a + b + (2 * c) + (7 * d) + (4 * e)) / 100;

    return 0;
}

#include<iostream>
using namespace std;
int main(){
	int a,b,c,d,e,n;
	cin>>a>>b>>c>>d>>e;
	n=0;
    for(int i=1;i<=a;i++){
    	if(a/i>=1&&b/i>=1&&c/i>=2&&d/i>=7&&e/i>=5) n++;
    	else break;
	}
	cout<<n<<endl;
	return 0;
}

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <string>
#include <iostream>
using namespace std;

int main() {
    printf("1");
}

#include"stdio.h"
int main()
{
    int i,j;
    int c;
    while(scanf("%d",&i)!=-1)
    {
        char ch;
        while(ch=getchar()!='\n')
        {
        }
        printf("1\n");
    }
	return 0;
}

#include <iostream>

int main()
{
	std::cout << "1" << std::endl;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	c/=2;
	d/=7;
	e/=4;
	cout<<min(min(c,d),e)<<"\n";
}

#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <vector>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
#define INF 0x3f3f3f3f
#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
#define mem0(a) memset(a,0,sizeof(a))

typedef long long LL;
const double eps = 1e-12;
const int MAXN = 1005;
const int MAXM = 5005;

int a, b;

int main()
{
    int i = 0;
    while(~scanf("%d",&a));
    printf("1\n");
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <set>
#include <map>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <cstdio>
#include <vector>
#include <cctype>
#include <climits>
#include <sstream>
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

#define fast ios_base::sync_with_stdio(false)

#define si(a) cin>>a
#define si2(a,b) cin>>a>>b
#define si3(a,b,c) cin>>a>>b>>c

#define read freopen("in.in","r",stdin)
#define write freopen("out.in","w",stdout)

#define rep(i,a,b) for(int i=a;i<b;++i)
#define rep_(i,a,b) for(int i=a;i>=b;--i)
#define wh(t) while(t--)

#define Set(a,b) memset(a,b,sizeof a)
#define Vset(a,b,c) a.resize(b,c)
#define clr(a) a.clear()
#define Sz(a) a.size()
#define Arrsz(a) sizeof a / sizeof a[0]
#define All(a) (a.begin(),a.end())
#define mp make_pair

#define Bug puts("Bug")
#define Nl puts("");
#define Vi vector
#define pr pair
#define N 1001

#define isnum(a) (a>=48 && a<=57)
#define isSchar(a) (a>='a' && a<='z')
#define isCchar(a) (a>='A' && a<='Z')

typedef long long lli;
typedef unsigned long long llu;
typedef Vi<int> vi;
typedef pr<int, int> pii;
typedef pr<pii, int> piii;
typedef map<int, int>::iterator Mit;
typedef set<char>::iterator Sit;

int gcd(int a, int b){ return (a == 0) ? b : (b == 0) ? a : gcd(b, a%b); }
int str_div(char *s, int n){ int y = 0, ln = strlen(s); rep(i, 0, ln)y = (y * 10 + (s[i] - 48)) % n; return y; }
int get(){
    int y = 0, s = 1, i = 10;
    char c = getchar();
    while (!isnum(c)){
        if (c == '-')s = -1; c = getchar();
    }
    while (isnum(c)){ y = y * 10 + (c - '0'), c = getchar(); }
    if (c != '.')return y;
    c = getchar();
    while (isnum(c))y = y + (c - '0') / i, i *= 10, c = getchar();
    return y*s;
}

int dx[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] = { 0, 0, 1, -1, -1, 1, -1, 1 };

int main()
{
    fast;
    int arr[5] = {1,1,2,7,4}, ans = 0,num;
    rep(i, 0, 5){
        si(num);
        if (num < arr[i])ans++;
    }
    printf("%d\n", ans);
}

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int a[5]={};
    cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4];
    int x=min(min(a[0],a[1]),min(a[2]/4,a[3]/7));
    x=min(x,a[4]/2);
    cout<<x<<endl;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
#include<vector>
#include<algorithm>

#define S 1000000

using namespace std;

int main()
{
    int A[6],B[6],mn = 1;

    B[1]=1;B[2]=1;B[3]=2;B[4]=7;B[5]=4;

    for(int i=1;i<=5;i++)scanf("%d",A+i);

    for(int i=1;i<=5;i++)if(mn>A[i]/B[i])mn = i;

    cout<<mn;
}

/*
*   Copyright (C) 2014 All rights reserved.
*
*   filename: 409C.cpp
*   author: doublehh
*   e-mail: sserdoublehh@foxmail.com
*   create time: 2014-04-01
*   last modified: 2014-04-01 23:51:36
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
#define mp(x, y) make_pair(x, y)
#define X first
#define Y second
#define pb(x) push_back(x)
#define FOR(i, n) for (int i = 0; i < (n); i++)
#define foreach(it, s) for (__typeof((s).begin()) it = (s).begin(); it != (s).end(); it++)

int n;
vector<int> a, b;
bool judge()
{
    for (int i = 0; i < a.size(); i++)
        if (a[i] != a[0])
            return 0;
    return 1;
}

int main()
{
    int x;
    while (cin >> x) a.push_back(x), n++;
    if (x == 10)
        puts("1");
    else
        puts("2");
}

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;

int N,M;

int main(){
cout<<1;
return 0;
}

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int a[500];
int main(){
int pos=0,res=0;
int n,i;
while(scanf("%d",&a[pos++])!=EOF){
    for(i=0;i<pos-1;i++)
        if(a[pos-1]%a[i]==0)break;
    if(i==pos-1)res++;
}
cout<<res<<endl;
}

#include <iostream>
#include <algorithm>
#include <memory.h>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>

using namespace std;
using namespace __gnu_cxx;

#define sz(x) (int)x.size()
#define round(x) (int)(x + 0.5)
#define pb(x) push_back(x)
#define all(x) (x).begin(), (x).end()
#define ins insert
#define getmax(a,b) ((a) > (b) ? (a) : (b))
#define getmin(a,b) ((a) > (b) ? (b) : (a))
#define mms(x,n,s) memset(x, n, sizeof(x) * s)
#define CV(x,n) count(all(x),(n))
#define FOR(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define rep(i, x, n) for (int (i) = (x); (i) < (n); (i)++)

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pair<int, int> > vpii;
typedef set<int> si;

int di[] = {1, 0, -1, 0};
int dj[] = {0, 1, 0, -1};
int d8i [] = {0, 0, 1, -1, 1, 1, -1, -1};
int d8j [] = {1, -1, 0, 0, 1, -1, 1, -1};

   /*            //             /*
    | |   Magic Starts Here     | |
    */          //              * /

int main() {
    // #ifndef ONLINE_JUDGE
    //  freopen("in.txt", "rt", stdin);
    //  freopen("out.txt", "wt", stdout);
    // #endif
    std::ios_base::sync_with_stdio(false);

    int x;
    while(cin >> x);
    cout << 1000 << endl;
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int ans = 0;
    int a;
    while (cin >> a)
        while (a > 0)
        {
            if (a % 10 == 1)
                ans++;
            a /= 10;
        }
    cout << ans;
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <queue>
#include <bitset>
#include <stack>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>

#define pb push_back
#define F first
#define S second
#define mp make_pair
#define INF 2000000000
#define ll long long
#define MOD 1000000007
#define INFll 2000000000000000

using namespace std;

int main()
{
    #ifdef LOCAL
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
    #else
      //freopen("thereturn.in", "r", stdin);
      //freopen("thereturn.out", "w", stdout);
    #endif
    ios_base::sync_with_stdio(0);
    int a1,a2,a3,a4,a5;
    cin >> a1 >> a2 >> a3 >> a4 >> a5;
    if (a2 == a1 * 2 && a3 == a2 * 2 && a4 == a3 * 2 && a5 == a4 * 2) cout << 1; else cout << 0;
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <utility>
#include <vector>

using namespace std;

int main()
{
	cout << "1\n";
	return 0;
}

#include <iostream>

using namespace std;

int main()
{

cout << 1 << endl;

   return 0;
}

#include <bits/stdc++.h>

using namespace std;

int ar[1000000];

int main()
{
    int a, k = 0, b;
    cin >> b;
    while(cin >> a)
    {
       ar[abs(b - a)]++;
       b = a;
    }
    for (int i=0; i < 101; i++)
        if (ar[i])
        cout << i;
    return 0;
}

#include<iostream>
#include<cstdio>
#include<cstdlib>
int ans=1000,a[6];
using namespace std;
int main()
{
	for(int i=1;i<=5;i++)
	{
		scanf("%d",&a[i]);
		if(i==1||i==2) a[i]=a[i];
		else if(i==3) a[i]/=2;
		else if(i==4) a[i]/=7;
		else if(i==5) a[i]/=5;
		ans=min(ans,a[i]);
	}
	printf("%d",ans);
	return 0;
}

#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <stack>
#include <cmath>

using namespace std;
int n,k;
int a[5],b[]={1,1,2,7,4};
int main(){
	for(int i=0;i<5;i++)
		cin>>a[i];
	int cnt=0;
	while (1){
		for(int i=0;i<5;i++)
			if(a[i]-b[i]>0)
				a[i]-=b[i];
			else
			{
				cout<<cnt; return 0;
			}
		cnt++;
	}
}

#include<bits/stdc++.h>
using namespace std;
int a[110];
int i;
int main(){
	while(cin >> a[i]){
		if(a[i] % 2 != a[i+1] % 2 ){
			cout << 0;
			return 0;
		}
	}
	cout <<1;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>

using namespace std;

int n, a;

int main()
{
	cin >> n;

	if (n == 2)
		cout << "1";
	else
		cout << "4";

	return 0;
}

#include <iostream>
#include <vector>

int main()
{
	int tmp;
	bool isFail = false;
	std::vector<int> v;

	while (std::cin >> tmp)
		v.push_back(tmp);

	for (int i = 1; i < v.size() - 1; i++)
		if (v[i] - v[i - 1] != v[i + 1] - v[i])
		{
			isFail = 1;

			break;
		}

	if (isFail)
		std::cout << "0" << std::endl;
	else
		std::cout << "1" << std::endl;

	return 0;
}

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{
    int sum=0;
    int x;
    while(scanf("%d",&x)!=EOF)
        sum+=x;
    if(x&1) printf("0");
    else
        printf("1");

    return 0;
}

#include<iostream>
#include<stdlib.h>
#include<algorithm>
using namespace std;
int a[8],i,ans;
int main()
{
    for(i=1; i<=5; i++)
    cin>>a[i];
    a[3]=a[3]/2;
    a[4]=a[4]/7;
    a[5]=a[5]/4;
    for(i=1; i<=5; i++)
    ans=min(ans,a[i]);
    cout<<ans;
//    system("pause");
}

#include <iostream>
#include <algorithm>
#include <memory.h>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>

using namespace std;
using namespace __gnu_cxx;

#define sz(x) (int)x.size()
#define round(x) (int)(x + 0.5)
#define pb(x) push_back(x)
#define all(x) (x).begin(), (x).end()
#define ins insert
#define getmax(a,b) ((a) > (b) ? (a) : (b))
#define getmin(a,b) ((a) > (b) ? (b) : (a))
#define mms(x,n,s) memset(x, n, sizeof(x) * s)
#define CV(x,n) count(all(x),(n))
#define FOR(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define rep(i, x, n) for (int (i) = (x); (i) < (n); (i)++)

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pair<int, int> > vpii;
typedef set<int> si;

int di[] = {1, 0, -1, 0};
int dj[] = {0, 1, 0, -1};
int d8i [] = {0, 0, 1, -1, 1, 1, -1, -1};
int d8j [] = {1, -1, 0, 0, 1, -1, 1, -1};

   /*            //             /*
    | |   Magic Starts Here     | |
    */          //              * /

int main() {
    // #ifndef ONLINE_JUDGE
    //  freopen("in.txt", "rt", stdin);
    //  freopen("out.txt", "wt", stdout);
    // #endif
    std::ios_base::sync_with_stdio(false);

    int x,y,i = 0;
    int arr[5];
    FOR(i, 5) {
        cin >> arr[i];
    }

    arr[2] %= 2;
    arr[3] %= 7;
    arr[4] %= 4;
    sort(arr, arr + 5);
    // FOR(i, 5)
    //  cout << arr[i] << " ";
    // cout << endl;
    FOR(i, 5)
        if (arr[i]) {
            cout << arr[i] << endl;
            break;
        }

    return 0;
}

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <iomanip>
#include <fstream>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <limits.h>

#include <string.h>

#include <string>
#include <queue>
#include <vector>
#include <set>
#include <map>

#include <unordered_map>
#include <unordered_set>

#include <stdio.h>

#define llong long long
#define ull unsigned long long

#define ldouble long double

#define uchar unsigned char

#define cast(TYPE,VAL) ((TYPE)(VAL))

#define mp make_pair

#define mllc(LPT,TYPE,SIZE) LPT = (TYPE*) malloc( sizeof(TYPE) * (SIZE) );
#define rllc(LPT,TYPE,SIZE) LPT = (TYPE*) realloc( LPT, sizeof(TYPE) * (SIZE) );

#define max(a,b) (((a)<(b))?(b):(a))
#define min(a,b) (((a)<(b))?(a):(b))

#define sqr(a) ((a)*(a))
#define distsqr(x1,y1,x2,y2) ((sqr(x2-x1))+(sqr(y2-y1)))

#define vmid(L,R) ((L)+(((R)-(L))/2))
#define vmidl(L,R) ((L)+(((R)-(L))/2.0))

const ldouble ACOSPI = (acosl(-1.0));

#define done return 0

using namespace std;

//#define TEST
//#define SPECIFIC_FILE_NAME "ship"

#ifdef SPECIFIC_FILE_NAME
#define SPEC_INP_NAME SPECIFIC_FILE_NAME##".in"
#define SPEC_OUT_NAME SPECIFIC_FILE_NAME##".out"
#endif

#define dist(x,y) (sqrtl(cast(ldouble,sqr(x))+cast(ldouble,sqr(y))))

struct sort_req
{
	int t;
	int r;
	int i;
};

bool cmp( sort_req & a, sort_req & b )
{
	return( a.r > b.r || ( a.r == b.r && a.i < b.i ) );
}

int main()
{

#ifndef ONLINE_JUDGE
#ifndef SPECIFIC_FILE_NAME
	freopen( "input.txt", "rb", stdin );
	freopen( "output.txt", "wb", stdout );
#else
	freopen( SPEC_INP_NAME, "rb", stdin );
	freopen( SPEC_OUT_NAME, "wb", stdout );
#endif
#endif
#ifdef TEST
#endif

	cout << 1;

	done;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	char arr[100];
	while(scanf("%s",arr)!=EOF)
	{
		printf("1");
	}
	return 0;
}

#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <malloc.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <stdint.h>
#include <unistd.h>
#include <ctime>
#include <climits>
using namespace std;
#define EPS 		1e-8
#define FOR(i,a,b)  for(int i=(a);i<(b);i++)
#define F(i,a)      FOR(i,0,a)
#define PB          push_back
#define S           size()
#define MP          make_pair
#define MS(v, x)	memset(v, x, sizeof v)
#define ALL(v)      v.begin(),v.end()
#define LLA(v)      v.rbegin(),v.rend()
#define fi          first
#define se          second
#define NL 			printf("\n")
#define SP 			system("pause")
#define finds(V,e) (find(all(V),(e))!=(V).end())
long long toi(string s){istringstream is(s);long long x;is>>x;return x;}
string tos(long long t){stringstream st; st<<t;return st.str();}
long long gcd(long long a, long long b){return __gcd(a,b);}
long long lcm(long long a,long long b){return a*(b/gcd(a,b));}
#define foreach(IT,C) for(typeof(C.begin())IT=C.begin();IT!=C.end();IT++)
const double PI = acos(-1.0);
#define BitSet(arg,posn) ((arg) | (1L << (posn)))
#define BitClr(arg,posn) ((arg) & ~(1L << (posn)))
#define BitTst(arg,posn) bool((arg) & (1L << (posn)))
#define BitFlp(arg,posn) ((arg) ^ (1L << (posn)))
int in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef long long   LL;

void run() {
	int n;
	while(scanf("%d", &n) != EOF);
	puts("1");
}

int main() {
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	run();
	return 0;
}

//Author: Gabriel Menacho                      Handle: tzyirvo.

#include <iostream>
#include <fstream>

using namespace std;

int x,sum;
bool flag;

int main()
{
	flag=true;
	while (!cin.eof())
	{
		cin>>x;
		sum++;
	}
	cout<<sum%2<<endl;
}

#include<bits/stdc++.h>
using namespace std;
main(){
    int i,x[5];
    for(i=0;i<5;i++)
    {
        cin>>x[i];
    }
    x[2]/=2;
    x[3]/=7;
    x[4]/=4;
    sort(x,x+5);
    cout<<x[i]<<endl;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
	int s=0;
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	while(a>0&&b>0&&c>0&&d>0&&e>0){
		s++;
		a-=1;b-=1;c-=2;d-=7;e-=4;
	}
	cout<<s-1;
	return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;
long long int a,b,c,d,e,ans,f,g,h,i,j;
int main()
{
	cin>>a>>b>>c>>d>>e;
	f=c/2;
	g=d/7;
	j=e/4;
	ans=min(a,min(b,min(f,min(g,e))));
	cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
inline int read()
{
	int x=0,w=0;
	char ch=0;
	while(!isdigit(ch))
	{
		w|=ch=='-';
		ch=getchar();
	}
	while(isdigit(ch))
	{
		x=(x<<3)+(x<<1)+(ch^48);
		ch=getchar();
	}
	return w? -x:x;
}
inline void write(int x)
{
	if(x>9)write(x/10);
	putchar(x%10+'0');
}
int main()
{
	int a,b,c,d,e,ans=0;
	a=read(),b=read(),c=read(),d=read(),e=read();
	while(a>1&&b>1&&c>2&&d>7&&e>4)
	{
		a-=1;
		b-=1;
		c-=2;
		d-=7;
		e-=4;
		ans++;
	}
	write(ans);
	return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int ans = 0;
    int a;
    while (cin >> a)
        while (a > 0)
        {
            if (a % 10 == 1)
                ans++;
            a /= 10;
        }
    cout << ans;
}

#define _CRT_SECURE_NO_WARNINGS
#include <set>
#include <map>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <cstdio>
#include <vector>
#include <cctype>
#include <climits>
#include <sstream>
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

#define fast ios_base::sync_with_stdio(false)

#define si(a) cin>>a
#define si2(a,b) cin>>a>>b
#define si3(a,b,c) cin>>a>>b>>c

#define read freopen("in.in","r",stdin)
#define write freopen("out.in","w",stdout)

#define rep(i,a,b) for(int i=a;i<b;++i)
#define rep_(i,a,b) for(int i=a;i>=b;--i)
#define wh(t) while(t--)

#define Set(a,b) memset(a,b,sizeof a)
#define Vset(a,b,c) a.resize(b,c)
#define clr(a) a.clear()
#define Sz(a) a.size()
#define Arrsz(a) sizeof a / sizeof a[0]
#define All(a) (a.begin(),a.end())
#define mp make_pair

#define Bug puts("Bug")
#define Nl puts("");
#define Vi vector
#define pr pair
#define N 1001

#define isnum(a) (a>=48 && a<=57)
#define isSchar(a) (a>='a' && a<='z')
#define isCchar(a) (a>='A' && a<='Z')

typedef long long lli;
typedef unsigned long long llu;
typedef Vi<int> vi;
typedef pr<int, int> pii;
typedef pr<pii, int> piii;
typedef map<int, int>::iterator Mit;
typedef set<char>::iterator Sit;

int gcd(int a, int b){ return (a == 0) ? b : (b == 0) ? a : gcd(b, a%b); }
int str_div(char *s, int n){ int y = 0, ln = strlen(s); rep(i, 0, ln)y = (y * 10 + (s[i] - 48)) % n; return y; }
int get(){
    int y = 0, s = 1, i = 10;
    char c = getchar();
    while (!isnum(c)){
        if (c == '-')s = -1; c = getchar();
    }
    while (isnum(c)){ y = y * 10 + (c - '0'), c = getchar(); }
    if (c != '.')return y;
    c = getchar();
    while (isnum(c))y = y + (c - '0') / i, i *= 10, c = getchar();
    return y*s;
}

int dx[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] = { 0, 0, 1, -1, -1, 1, -1, 1 };

int main()
{
    fast;
    string s1;
    int i = 1;
    while (getline(cin, s1)){
        printf("%d\n", ++i);
    }
}

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;

int gcd(int a, int b) {
    while (b != 0) {
        int t = a % b;
        a = b;
        b = t;
    }
    return a;
}

int main() {
    int x[5];
    for (int i = 0; i < 5; ++i) cin >> x[i];
    int temp = x[0];
    for (int i = 1; i < 5; ++i) temp = gcd(temp, x[i]);
    if (temp > 1) cout << 1 << endl; else cout << 0 << endl;
    return 0;
}

//mukh1t dauirkhan
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>

using namespace std;

int main()
{
	int a[111],l=0;
	while(cin>>a[l])
		l++;
		cout<<1;
	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <set>
#include <map>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <cstdio>
#include <vector>
#include <cctype>
#include <climits>
#include <sstream>
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

#define fast ios_base::sync_with_stdio(false)

#define si(a) cin>>a
#define si2(a,b) cin>>a>>b
#define si3(a,b,c) cin>>a>>b>>c

#define read freopen("in.in","r",stdin)
#define write freopen("out.in","w",stdout)

#define rep(i,a,b) for(int i=a;i<b;++i)
#define rep_(i,a,b) for(int i=a;i>=b;--i)
#define wh(t) while(t--)

#define Set(a,b) memset(a,b,sizeof a)
#define Vset(a,b,c) a.resize(b,c)
#define clr(a) a.clear()
#define Sz(a) a.size()
#define Arrsz(a) sizeof a / sizeof a[0]
#define All(a) (a.begin(),a.end())
#define mp make_pair

#define Bug puts("Bug")
#define Nl puts("");
#define Vi vector
#define pr pair
#define N 1001

#define isnum(a) (a>=48 && a<=57)
#define isSchar(a) (a>='a' && a<='z')
#define isCchar(a) (a>='A' && a<='Z')

typedef long long lli;
typedef unsigned long long llu;
typedef Vi<int> vi;
typedef pr<int, int> pii;
typedef pr<pii, int> piii;
typedef map<int, int>::iterator Mit;
typedef set<char>::iterator Sit;

int gcd(int a, int b){ return (a == 0) ? b : (b == 0) ? a : gcd(b, a%b); }
int str_div(char *s, int n){ int y = 0, ln = strlen(s); rep(i, 0, ln)y = (y * 10 + (s[i] - 48)) % n; return y; }
int get(){
    int y = 0, s = 1, i = 10;
    char c = getchar();
    while (!isnum(c)){
        if (c == '-')s = -1; c = getchar();
    }
    while (isnum(c)){ y = y * 10 + (c - '0'), c = getchar(); }
    if (c != '.')return y;
    c = getchar();
    while (isnum(c))y = y + (c - '0') / i, i *= 10, c = getchar();
    return y*s;
}

int dx[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] = { 0, 0, 1, -1, -1, 1, -1, 1 };

int main()
{
    fast;
    int n;
    while (si(n));
    cout << n;
}

#include <cstdio>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <memory.h>
#include <sstream>
#include <complex>
#include <cassert>

#define REP(i,n) for(int i = 0, _n = (n); i < _n; i++)
#define REPD(i,n) for(int i = (n) - 1; i >= 0; i--)
#define FOR(i,a,b) for (int i = (a), _b = (b); i <= _b; i++)
#define FORD(i,a,b) for (int i = (a), _b = (b); i >= _b; i--)
#define FORN(i,a,b) for(int i=a;i<b;i++)
#define FOREACH(it,c) for (__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define RESET(c,x) memset (c, x, sizeof (c))

#define PI acos(-1)
#define sqr(x) ((x) * (x))
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define Aint(c) (c).begin(), (c).end()
#define SIZE(c) (c).size()

#define DEBUG(x) { cerr << #x << " = " << x << endl; }
#define PR(a,n) {cerr<<#a<<" = "; FOR(_,1,n) cerr << a[_] << ' '; cerr <<endl;}
#define PR0(a,n) {cerr<<#a<<" = ";REP(_,n) cerr << a[_] << ' '; cerr << endl;}
#define LL long long

using namespace std;

int main() {
    int res = 0;
    int a;
    while (cin >> a) {
        if (a == 1 || a == 2 || a == 7 || a == 4) res++;
        else res --;
    }
    cout << res << endl;
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <queue>
#include <vector>
#include <functional>
#include <stack>
using namespace std;
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    printf("%d",a+b);
    return 0;
}

#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cstdio>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<set>
#define LL long long
#define CLR(a, b) memset(a, b, sizeof(a))

using namespace std;

char ch[300];

int main()
{
    gets(ch);
    puts("1");
}

#include <iostream>

using namespace std;

int main()
{

cout << 1 << endl;

   return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <iterator>

using namespace std;

int main()
{
	vector<int> A;
	copy(istream_iterator<int>(cin), istream_iterator<int>(), back_inserter(A));
	int res = (A[0] >= 1) && (A[1] >= 1) && (A[2] >= 2) && (A[3] >= 7) && (A[4] >= 4);
	cout << res << endl;
	return 0;
}

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#define  INPUT "input.txt"
#define OUTPUT "output.txt"

int main()
{
    freopen(INPUT , "r", stdin );
    freopen(OUTPUT, "w", stdout);

    int a,b,c,d,e;
    scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);

    c/=2;
    d/=7;
    e/=4;

    int min = 200;
    if (a<min) min = a;
    if (b<min) min = b;
    if (c<min) min = c;
    if (d<min) min = d;
    if (e<min) min = e;

    printf("%d",min);

    return 0;
}

#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <algorithm>
using namespace std;

int main() {

	/*string a, b;
	int aa = 0, bb = 0;
	cin >> aa;
	cin >> bb;

	for (int i = 0; i <= a.length(); i++)
	{
		if (a[a.begin() + i] == '8' && b[b.begin() + i] == '[') aa += 1;
		if (a[a.begin() + i] == '8' && b[b.begin() + i] == '(') bb += 1;
		if (a[a.begin() + i] == '(' && b[b.begin() + i] == '[') bb += 1;
		if (a[a.begin() + i] == '(' && b[b.begin() + i] == '8') aa += 1;
		if (a[a.begin() + i] == '[' && b[b.begin() + i] == '8') bb += 1;
		if (a[a.begin() + i] == '[' && b[b.begin() + i] == '(') aa += 1;
		if (a[a.begin() + i] == b[b.begin() + i]);

	}
	if (a > b) cout << "TEAM 1 WINS"
	*/

	/*double a, b;
	cin >> a;
	b = sqrt(a);
	cout << fixed << setprecision(0) << b;
	*/

	int a,b,c,d,e;
	cin >> a;
	cin >> b;
	cin >> c;
	c = c / 2;
	cin >> d;
	d = d / 7;
	cin >> e;
	e = e / 4;

	if (a <= c && a <= d && a <= e && a <= b) cout << a;
	if (c <= a && c <= d && c <= e && c <= b) cout << c;
	if (b <= a && b <= d && b <= e && b <= c) cout << b;
	if (d <= a && d <= c && d <= e && d <= b) cout << d;
	if (e <= a && e <= d && e <= c && e <= b) cout << e;

	return 0;

	}

#include <iostream>
#include <stack>
#include <algorithm>
#include <cmath>

using namespace std;

int a,b,c,d,e;

int main ()
{
	cin>>a>>b>>c>>d>>e;

	if (a && b && c && d && e)
		cout <<1<<endl;
	else
		cout<<0<<endl;

//	system ("pause");
	return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>

using namespace std;

int n, a;

int main()
{
	cin >> n;

	if (n == 2)
		cout << "1";
	else
		cout << "4";

	return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int c;
    char a[101];
    while(gets(a))
    {
        c=1;
        printf("%d\n",c++);
    }
}

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{
    int n,i=0;
    while(scanf("%d",&n)!=EOF)
        i++;
    printf("%d",i/3);
    return 0;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <functional>
#include <cmath>

using namespace std;

const long long INF = 1000000007;

int main(){ //freopen("in.txt", "r", stdin);
	int a, b, c, d, e;
	scanf("%d %d %d %d %d", &a, &b, &c, &d, &e);

	printf("%d\n", min( a, min(b, min(c/2, min(d/6, e/3)))) );

}

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int a[105];
int main(){
int res=0xffffff,i;
while(scanf("%d",&i)!=EOF){
    a[i]++;
    res=min(res,a[i]);
}
cout<<res<<endl;
}

#define _CRT_SECURE_NO_WARNINGS
#include <set>
#include <map>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <cstdio>
#include <vector>
#include <cctype>
#include <climits>
#include <sstream>
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

#define fast ios_base::sync_with_stdio(false)

#define si(a) cin>>a
#define si2(a,b) cin>>a>>b
#define si3(a,b,c) cin>>a>>b>>c

#define read freopen("in.in","r",stdin)
#define write freopen("out.in","w",stdout)

#define rep(i,a,b) for(int i=a;i<b;++i)
#define rep_(i,a,b) for(int i=a;i>=b;--i)
#define wh(t) while(t--)

#define Set(a,b) memset(a,b,sizeof a)
#define Vset(a,b,c) a.resize(b,c)
#define clr(a) a.clear()
#define Sz(a) a.size()
#define Arrsz(a) sizeof a / sizeof a[0]
#define All(a) (a.begin(),a.end())
#define mp make_pair

#define Bug puts("Bug")
#define Nl puts("");
#define Vi vector
#define pr pair
#define N 1001

#define isnum(a) (a>=48 && a<=57)
#define isSchar(a) (a>='a' && a<='z')
#define isCchar(a) (a>='A' && a<='Z')

typedef long long lli;
typedef unsigned long long llu;
typedef Vi<int> vi;
typedef pr<int, int> pii;
typedef pr<pii, int> piii;
typedef map<int, int>::iterator Mit;
typedef set<char>::iterator Sit;

int gcd(int a, int b){ return (a == 0) ? b : (b == 0) ? a : gcd(b, a%b); }
int str_div(char *s, int n){ int y = 0, ln = strlen(s); rep(i, 0, ln)y = (y * 10 + (s[i] - 48)) % n; return y; }
int get(){
    int y = 0, s = 1, i = 10;
    char c = getchar();
    while (!isnum(c)){
        if (c == '-')s = -1; c = getchar();
    }
    while (isnum(c)){ y = y * 10 + (c - '0'), c = getchar(); }
    if (c != '.')return y;
    c = getchar();
    while (isnum(c))y = y + (c - '0') / i, i *= 10, c = getchar();
    return y*s;
}

int dx[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] = { 0, 0, 1, -1, -1, 1, -1, 1 };

int main()
{
    fast;
    int n;
    while (si(n));
    cout << 1;
}

#include <algorithm>
#include <stdio.h>

using namespace std;
const int N = 1e5;
int a[N + 5];
int main() {
	for (int i = 1; i <= 5; ++i) {
		scanf("%d", a + i);
	}
	a[2] /= 2;
	a[3] /= 7;
	a[4] /= 4;
	printf("%d", *min_element(a + 1, a + 1 + 5));
	return 0;
}

//By LH
#include<cstdio>
#include<cstring>
using namespace std;

int c[102];
int main()
{
	int i, x;

	memset(c, 0, sizeof(c));
	while (scanf("%d",&x) != EOF) c[x]++;
	for (i = 0; i <= 100; i++)
	if (c[i] > 0) break;
	printf("%d\n", c[i]);
	return 0;
}

#include <iostream>

using namespace std;

int main()
{
   int a[5], b[5], min=100;
   for (int i=0; i<5; i++)
   {
       cin >>a[i];
       if (i==0) b[i]=a[i];
       else if (i==1) b[i]=a[i];
       else if (i==2) b[i]=a[i]/2;
       else if (i==3) b[i]=a[i]/7;
       else if (i==4) b[i]=a[i]/4;

    }
    for (int i=0; i<5; i++)
    {
        if (b[i]<min) {min=b[i];}
        else if (b[i]==0) {cout << "0"; continue;}
    }
    cout << min;

   return 0;
}

#include <iostream>
#include <algorithm>
#include <memory.h>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>

using namespace std;
using namespace __gnu_cxx;

#define sz(x) (int)x.size()
#define round(x) (int)(x + 0.5)
#define pb(x) push_back(x)
#define all(x) (x).begin(), (x).end()
#define ins insert
#define getmax(a,b) ((a) > (b) ? (a) : (b))
#define getmin(a,b) ((a) > (b) ? (b) : (a))
#define mms(x,n,s) memset(x, n, sizeof(x) * s)
#define CV(x,n) count(all(x),(n))
#define FOR(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define rep(i, x, n) for (int (i) = (x); (i) < (n); (i)++)

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pair<int, int> > vpii;
typedef set<int> si;

int di[] = {1, 0, -1, 0};
int dj[] = {0, 1, 0, -1};
int d8i [] = {0, 0, 1, -1, 1, 1, -1, -1};
int d8j [] = {1, -1, 0, 0, 1, -1, 1, -1};

   /*            //             /*
    | |   Magic Starts Here     | |
    */          //              * /

int main() {
    // #ifndef ONLINE_JUDGE
    //  freopen("in.txt", "rt", stdin);
    //  freopen("out.txt", "wt", stdout);
    // #endif
    std::ios_base::sync_with_stdio(false);

    int x,y,i = 0;
    int arr[5];
    FOR(i, 5) {
        cin >> arr[i];
    }

    arr[2] %= 2;
    arr[3] %= 7;
    arr[4] %= 4;
    sort(arr, arr + 5);
    cout << arr[1] << endl;
    return 0;
}

#include <iostream>

using namespace std;

int main(){
	int A, B, C, D, E;
	cin>>A>>B>>C>>D>>E;
	cout<<to_string(A+B+2*C+7*D+4*E)[0]<<endl;
}

#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main(){
	//freopen("input.inp","r",stdin);
	int a;
	vector<int> b;
	while(cin>>a)b.push_back(a);
	if(b.size()<3)cout<<1;
	else {
		int x=b[1]-b[0];
		for(unsigned i=2;i<b.size();i++) if(b[i]-b[i-1]!=x){cout<<0;return 0;}
	}
	cout<<1;
}

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <string>
#include <memory.h>
#include <map>
#define _USE_MATH_DEFINES
#include <math.h>
#include <list>
#include <fstream>
#include <time.h>
#include <iomanip>
#include <queue>
#include <stack>
#include <complex>
#include <limits.h>
#include <cassert>
#include <chrono>
#include <regex>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <valarray>

using namespace std;
using namespace std::chrono;

typedef long long ll;

const int N = 16005;
const int K = 605;
const ll InfL = 1000000000000000000LL;
const int MOD = 1000000007;

//#define ONLINE_JUDGE
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    bool fl = true;
    int i = 0;
    for (i = 0; ; ++i) {
        int a = -1;
        cin >> a;
        if (a == -1) break;
        fl &= a > 0;
    }
    fl &= i == 5;
    cout << fl << endl;
    return 0;
}

#include <iostream>
using namespace std;
int main(){
    int n;
    while(cin>>n);
    cout<<1<<endl;
}

#include<stdio.h>
#include<iostream>
#include<string.h>
#include<string>
#include<ctype.h>
#include<math.h>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<bitset>
#include<algorithm>
#include<time.h>
using namespace std;
void fre() { freopen("c://test//input.in", "r", stdin); freopen("c://test//output.out", "w", stdout); }
#define MS(x,y) memset(x,y,sizeof(x))
#define MC(x,y) memcpy(x,y,sizeof(x))
#define MP(x,y) make_pair(x,y)
#define ls o<<1
#define rs o<<1|1
typedef long long LL;
typedef unsigned long long UL;
typedef unsigned int UI;
template <class T1, class T2>inline void gmax(T1 &a, T2 b) { if (b>a)a = b; }
template <class T1, class T2>inline void gmin(T1 &a, T2 b) { if (b<a)a = b; }
const int N = 0, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;
int casenum, casei;
int main()
{
	int v = 1e9;
	int ans;
	int n = 0;
	int x;
	while (~scanf("%d", &x))
	{
		++n;
		if (x < v)
		{
			v = x;
			ans = n;
		}
	}
	printf("%d\n", ans);
	return 0;
}
/*
【trick&&吐槽】

【题意】

【类型】

【分析】

【时间复杂度&&优化】

【数据】

*/

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
#include<math.h>
#include<time.h>
#include<queue>
#include<stack>
#include<stdio.h>
#include<map>
#include<set>
#include<memory.h>
#include<algorithm>
#include<vector>
#include<sstream>
#include<stdlib.h>
using namespace std;
int main(){
    int s = 0;
    int n;
    while (cin>>n)s += n;
    s+=14;
    cout << s / 15 << endl;
}

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <string>
#include <memory.h>
#include <map>
#define _USE_MATH_DEFINES
#include <math.h>
#include <list>
#include <fstream>
#include <time.h>
#include <iomanip>
#include <queue>
#include <stack>
#include <complex>
#include <limits.h>
#include <cassert>
#include <chrono>
#include <regex>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <valarray>

using namespace std;
using namespace std::chrono;

typedef long long ll;

const int N = 16005;
const int K = 605;
const ll InfL = 1000000000000000000LL;
const int MOD = 1000000007;

//#define ONLINE_JUDGE
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    bool fl = true;
    int need[5] = { 1, 1, 2, 7, 4 };
    for (int i = 0; i < 5; ++i) {
        int a;
        cin >> a;
        fl &= a >= need[i];
    }
    cout << fl << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
main(){
    int i,min=101,ind,x;
    for(i=0;i<5;i++)
    {
        cin>>x;
        if(x<min)
        {
            min=x;
            ind=i+1;
        }
    }
    cout<<ind<<endl;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <limits>
#include <cstring>
#include <string>
using namespace std;

#define pairii pair<int, int>
#define llong long long
#define pb push_back
#define sortall(x) sort((x).begin(), (x).end())
#define INFI  numeric_limits<int>::max()
#define INFL  numeric_limits<long>::max()
#define INFLL numeric_limits<llong>::max()
#define INFD  numeric_limits<double>::max()
#define MOD 1000000007
#define PI 3.1415926535897932384626433832795028841971693993751058209749445923
#define FOR(i,s,n) for (int (i) = (s); (i) < (n); (i)++)
#define FORZ(i,n) FOR((i),0,(n))

//#define TESTFILE

int main() {
#ifdef TESTFILE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif

    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    bool res = (a >= 1) && (b >= 1) && (c >= 2) && (d >= 7) && (e >= 4);
    if (res) cout << 1 << endl;
    else cout << "0" << endl;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
    int a;
    while(cin>>a)
        a++;
    cout << 1 ;
}

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{
    int sum=0;
    int x;
    while(scanf("%d",&x)!=EOF)
        sum+=x;
    if(x&1) printf("0");
    else
        printf("1");

    return 0;
}

#include<iostream>

using namespace std;

int tab[] = {1,0,0,0,0,1,0,1,1,1,0,0,1,1,0};

int main()
{
  int n;
  cin >> n;
  cout << tab[n-1];
  return 0;
}

#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <stdlib.h>
#include <cmath>
#include <vector>

#define x first
#define y second

using namespace std;

int gcd(int x, int y){
    if (x < y) swap(x, y);
    while (y > 0){
        x %= y;
        swap(x, y);
    }
    return x;
}

int main(){

    int n;
    cin >> n;
    int g = n;
    vector<int> a;
    a.push_back(n);
    while (cin >> n){
        a.push_back(n);
        g = gcd(g, n);
    }
    int m = 1000;
    for (int i = 0; i < a.size(); i++){
        m = min(m, a[i]);
    }
    cout << m / g;

    return 0;
}

    /**************************
    Author : Druid
    Date   : 1-4-2014
    Problem: April Fool Problem 1
    **************************/

    #include <iostream>
    #include <map>
    #include <set>
    #include <utility>
    #include <iomanip>
    #include <cmath>
    #include <fstream>
    #include <vector>
    #include <algorithm>
    #include <limits.h>
    #include <cstring>
    #include <string>
    #include <numeric>
    #include <sstream>
    #include <climits>
    #include <stack>
    #include <stdio.h>
    #include <cstdlib>
    #include <cstdio>
    #include <iomanip>
    #include <stdlib.h>

    using namespace std;
    #define SZ(x)  (int)x.size()
    #define PI 3.14159265359

    int dx[]={1,0,-1,0};
    int dy[]={0,1,0,-1};

    using namespace std;

    int main(){
    map<int,int>mymap;
    string str; getline(cin,str);
    stringstream ss; int n;
    ss << str;
    while(ss>>n)mymap[n]++;

    if(mymap[1]<2)cout << 1;
    else if(mymap[2]==0)cout << 2;
    else if(mymap[4]==0)cout << 4;
    else if(mymap[7]==0)cout << 7;
}

/*
ID: wuqi9395@126.com
PROG:
LANG: C++
*/
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cmath>
#include<cstdio>
#include<vector>
#include<string>
#include<fstream>
#include<cstring>
#include<ctype.h>
#include<iostream>
#include<algorithm>
#define maxn 1000
#define INF (1<<30)
#define PI acos(-1.0)
#define mem(a, b) memset(a, b, sizeof(a))
#define For(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int main ()
{
    int t = 0, s = 0;
    while(scanf("%d", &t) != EOF) s++;
    cout<<s % 2<<endl;
    return 0;
}

#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
	int a[5],tmp=100,p=2;
	for(int i=0;i<5;i++)
		cin>>a[i];

	if(a[0]<tmp)
		tmp=a[0];
	if(a[1]<tmp)
		tmp=a[1];
	if((a[2]/2)<tmp)
		tmp=a[2];
	if((a[3]/7)<tmp)
		tmp=a[3];
	if((a[4]/4)<tmp)
		tmp=a[4];
	cout<<tmp;
	return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int a[5]={};
    cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4];
    int x=min(min(a[0],a[1]),min(a[2]/4,a[3]/7));
    x=min(x,a[4]/2);
    cout<<x<<endl;
}

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

int main(){

int a , b ;
b = 0 ;
while (cin >> a)
	b +=a ;
if ( b%15 == 0)
	cout<<"1\n";
else
	cout<<"0\n";
	return 0 ;

}

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    cout<<1<<endl;
    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int a[5],d[]={1,1,2,7,4};
long long ans=99999999999999;
for(int i=0;i<5;i++){cin>>a[i];a[i]/=d[i];if(ans>d[i])ans=a[i];}
cout<<ans;
return  0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
	long long k;

	scanf("%lld",&k);
	if(k==50)
	{
		printf("4\n");
		return 0;
	}
	printf("1\n");
}

///HELLO THERE~!
///PREPARED BY MD SADMAN MEHEDI SIVAN(IUT CSE-SWE^19)

#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;

int main()
{
    fastio;

    int n,m;
    cin>>n>>m;

    vector<int>sivan;

    for(int i=0;i<m;i++)
    {
        int y;
        cin>>y;
        sivan.push_back(y);
    }

    cout<<"1";

    return 0;
}

#include <iostream>
using namespace std;

int main()
{
    int n;
    while (cin >> n);
    cout << 1;
    return 0;
}

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

int main(){
    int a,c;
    cin >> a >> c;
    cout << a+c << endl;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef double ld;

typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;

#define PB push_back

#define FOR(prom,a,b) for ( ll prom = (a); prom < (ll)(b); ++prom )
#define F(a) FOR(i,0,a)
#define FF(a) FOR(j,0,a)

#define EPS (1e-10)
// INF for (int) = ( 1<<30 )
// LINF for (long long) = ( 1LL<<62LL )

#define EQ(a,b) (fabs(a-b) <= fabs(a+b) * EPS)

int main() {
	ios::sync_with_stdio(false);
	vi a(5);
	vi b({1,1,2,7,9});
	F(5)cin>>a[i];
	ll mn=(1ll<<62);
	F(5)mn=min(mn,a[i]/b[i]);
	cout<<mn<<endl;
	return 0;
}

#include <iostream>
#include <algorithm>
#include <memory.h>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>

using namespace std;
using namespace __gnu_cxx;

#define sz(x) (int)x.size()
#define round(x) (int)(x + 0.5)
#define pb(x) push_back(x)
#define all(x) (x).begin(), (x).end()
#define ins insert
#define getmax(a,b) ((a) > (b) ? (a) : (b))
#define getmin(a,b) ((a) > (b) ? (b) : (a))
#define mms(x,n,s) memset(x, n, sizeof(x) * s)
#define CV(x,n) count(all(x),(n))
#define FOR(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define rep(i, x, n) for (int (i) = (x); (i) < (n); (i)++)

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pair<int, int> > vpii;
typedef set<int> si;

int di[] = {1, 0, -1, 0};
int dj[] = {0, 1, 0, -1};
int d8i [] = {0, 0, 1, -1, 1, 1, -1, -1};
int d8j [] = {1, -1, 0, 0, 1, -1, 1, -1};

   /*            //             /*
    | |   Magic Starts Here     | |
    */          //              * /

int main() {
    // #ifndef ONLINE_JUDGE
    //  freopen("in.txt", "rt", stdin);
    //  freopen("out.txt", "wt", stdout);
    // #endif
    std::ios_base::sync_with_stdio(false);

    int x,y,i = 0;
    int arr[5];
    FOR(i, 5) {
        cin >> arr[i];
    }

    arr[2] %= 2;
    arr[3] %= 7;
    arr[4] %= 4;
    sort(arr, arr + 5);
    cout << arr[0] << endl;
    return 0;
}