2
1 18
 9
6 20 27 28 40 53 59 70 85
 8
10 20 30 40 50 60 70 80
 6
13 17 32 47 60 66
 1
1
 8
5 17 20 35 42 53 67 76
 1
90
 6
14 29 43 59 70 74
 76
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
 8
15 20 30 40 50 60 73 83
 14
14 22 27 31 35 44 46 61 62 69 74 79 88 89
 30
6 11 12 15 22 24 30 31 32 33 34 35 40 42 44 45 47 50 53 54 57 58 63 67 75 77 79 81 83 88
 84
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
 6
15 30 45 60 74 89
 9
15 28 39 48 55 60 63 64 74
 1
15
 9
10 20 30 40 50 60 70 80 84
 25
1 2 3 4 5 6 7 8 9 10 11 23 36 50 65 81 82 83 84 85 86 87 88 89 90
 5
15 30 45 60 74
 2
16 50
 12
14 22 27 31 35 44 62 69 74 79 88 89
 10
15 28 39 48 55 60 63 64 74 82
 60
1 2 4 5 6 7 11 14 16 18 20 21 22 23 24 25 26 33 34 35 36 37 38 39 41 42 43 44 46 47 48 49 52 55 56 57 58 59 60 61 63 64 65 67 68 70 71 72 73 74 75 77 78 80 82 83 84 85 86 88
 6
15 30 45 60 75 84
 90
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
 3
1 20 90
 8
1 16 30 31 32 33 34 50
 72
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
 12
1 3 6 10 15 21 28 36 45 55 66 78
 1
16
 5
15 30 45 60 75

16
 90
 90
 81
 16
 90
 15
 58
 90
 90
 90
 90
 90
 90
 89
 30
 90
 80
 89
 15
 59
 90
 90
 90
 90
 16
 49
 54
 90
 15
 90

//DEEPANSHU SAXENA
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define DEBUG(x) cerr<< '"' << #x << '"' << " : " << x << endl;	
#define ll long long
#define array(x,n) (x,x+n)
#define all(c) (c).begin(),(c).end()
#define VECTOR(v) cout << '>' << #v << ':' ; vector_out(v);
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ip(x) cin>>x
#define op(x) cout<<x<<endl
#define db(x) cerr<<x<<endl
#define opn(x) cout<<x
#define ops(x) cout<<x<<" "
#define odd(x) (x&1)
#define dbs(x) cerr << x << " ";
#define dbn(x) cerr << x
#define Pll pair<ll,ll>
#define P_Pll_ll pair<Pll,ll>
#define VLL std::vector<ll>
#define VB std::vector<bool>
#define even(x) (!x&1)
#define cpresent(a,x) (find(all(a),x) != (a).end())
#define it(a,i) for(typeof((a).begin() i = (a).begin(); i != (a).end(); i++)
#define present(a,x) ((a).find(x) != (a).end())
#define fbei(i,x,y,z) for(ll i=x;i<=y;i+=z)
#define fbe(i,x,y) for(ll i=x;i<=y;i++)
#define feb(i,x,y)for(int i=x;i>=y;i--)
#define f(i,n) for(ll i=0;i<n;i++)
#define pb push_back
#define mp(x,y) make_pair(x,y)
#define GCD(x,y) __gcd(x,y)
#define out(x,n) cout<<fixed<<setprecision(n)<<x<<endl;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
vector<ll> vector_in(ll n)
{
    vector<ll> v(n);
    for(ll i=0;i<n;i++)
    cin>>v[i];
    return v;
}
void vector_out(vector<ll> v)
{
    for(ll i=0;i<v.size();i++)
    cout<<v[i]<<" ";
    cout<<endl;
}
ll vector_sum(vector<ll> v)
{
    ll sum;
    for(ll i=0;i<v.size();i++)
    sum+=v[i];
    return sum;
}
vector<string> GenerateTokens()
{
	string input;
	getline(cin,input);
	vector<string> inp;
	stringstream check1(input);
	string iter;
	while(getline(check1,iter,' '))
		inp.push_back(iter);
	return inp;
}
void Done()
{
	ll n;
	ip(n);
	std::vector<ll> x(n);
	f(iteratorr,n)
		ip(x[iteratorr]);
	if(x[0]>15)
	{
		op("15");
		return;
	}
	fbe(iteratorr,1,n-1)
	{
		// dbs(x[iteratorr]-x[iteratorr-1]);
		if(x[iteratorr]-x[iteratorr-1]>15)
		{
			op(x[iteratorr-1]+15);
			return;
		}
	}
	// op(x[n-1]);
	if(90-x[n-1]<15)
		op("90");
	else
		op(x[n-1]);
}
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    freopen("errors.txt","w",stderr);
    #endif
    ll Test = 1LL;
    // ip(Test);
    while(Test--)
        Done();
}