Bear Limak likes watching sports on TV. He is going to watch a game today. The game lasts 90 minutes and there are no breaks.

Each minute can be either interesting or boring. If 15 consecutive minutes are boring then Limak immediately turns TV off.

You know that there will be n interesting minutes t_1, t_2, ..., t_{n}. Your task is to calculate for how many minutes Limak will watch the game.


-----Input-----

The first line of the input contains one integer n (1 ≤ n ≤ 90) — the number of interesting minutes.

The second line contains n integers t_1, t_2, ..., t_{n} (1 ≤ t_1 < t_2 < ... t_{n} ≤ 90), given in the increasing order.


-----Output-----

Print the number of minutes Limak will watch the game.


-----Examples-----
Input
3
7 20 88

Output
35

Input
9
16 20 30 40 50 60 70 80 90

Output
15

Input
9
15 20 30 40 50 60 70 80 90

Output
90



-----Note-----

In the first sample, minutes 21, 22, ..., 35 are all boring and thus Limak will turn TV off immediately after the 35-th minute. So, he would watch the game for 35 minutes.

In the second sample, the first 15 minutes are boring.

In the third sample, there are no consecutive 15 boring minutes. So, Limak will watch the whole game.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
a = list(map(int, input().split()))

cutoff = 15
for x in a:
    if x > cutoff:
        break
    cutoff = x + 15

print(min(90, cutoff))


n, t, c = int(input()), set(map(int, input().split())), 0
for i in range(1, 91):
    c = 0 if i in t else c + 1
    if c == 15:
        print(i)
        return
print(90)

n = int(input())
a = list(map(int, input().split()))
cur = 15
for i in range(n):
    if a[i] > cur:
        break
    cur = a[i] + 15
cur = min(cur, 90)
print(cur)


import math
from collections import Counter

def solve():
    n = int(input())
    T = [int(x) for x in input().split()]
    time = 0
    for t in T:
        if t > min(time + 15, 90):
            return min(time + 15, 90)
        else:
            time = t
    return min(time + 15, 90)

print(solve())



n = int(input())
a = list(map(int, input().split()))
cur = 0
prev = 0
for t in a:
    if t - prev > 15:
        break
    cur = t
    prev = t
cur = min(cur + 15, 90)
print(cur)


n = int(input())
T = [0]+list(map(int, input().split()))+[90]
ok = 1
for i in range(1,n+2):
    if T[i]-T[i-1]>15:
        print(T[i-1]+15)
        ok = 0
        break
if ok:
    print(90)


import sys
import math
import itertools as it
import operator as op
import fractions as fr

# n,m = map(int,sys.stdin.readline().split())
n = int(sys.stdin.readline().strip())
T = list(map(int,sys.stdin.readline().split()))

d = 0
for t in T:
  if t - d > 15:
    break
  else:
    d = t

d = min(d+15,90)
print(d)



n = int(input())
s = [0]+[int(i) for i in input().split()]
for i in range(n):
	if s[i+1]-s[i]>15:
		print(s[i]+15)
		break
else:
	print(min(s[-1]+15, 90))


n = int(input())
t = list(map(int, input().split()))
a = [0] * 91
c = True
for e in t:
    a[e] = 1
for i in range(1, 91):
    if a[i] == 1:
        a[i] = 0
    else:
        a[i] = a[i - 1] + 1
    if a[i] == 15:
        print(i)
        c = False
        break
if c == True:
    print(90)


n = int(input())
ti = list(map(int,input().split()))
t2 = [0]*91
for i in ti:
    t2[i] = 1
num = 0
ans = 0
for i in range(1,91):
    if t2[i] == 0:
        num += 1
    else:
        num = 0
    ans = i
    if num >= 15:
        break
print(ans)


n = int(input())
lst = list(map(int, input().split()))

free = [False] * 91

for x in lst:
	free[x] = True

not_false = 0
for i in range(1, len(free)):
	if free[i]:
		not_false = i
	else:
		if abs(i - not_false) >= 15:
			print(i)
			return
print(90)

3

n = input()
v = list(map(int, input().split()))
v = v[::-1]
v.append(0)
v = v[::-1]
v.append(91)

sol = 90
for i in range(0, len(v)-1):
    if v[i] + 15 < v[i+1]:
        sol = v[i]+15
        break

sol = min(sol, 90)
print(sol)


n = int(input())
l = [0] + list(map(int, input().split()))
i = 1
curr = 0
while i != n + 1 and l[i] - curr <= 15:
    curr = l[i]
    i += 1
print(min(90, l[i - 1] + 15))

n = input()
t = list(map(int, input().split()))

n = [0 for _ in range(90)]
for i in t:
    n[i - 1] = 1

s = 0
ni = 0
for i in n:
    if ni == 15:
        break
    if i == 1:
        ni = 0
    elif i == 0:
        ni += 1
    s += 1

print(s)
    


n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(n):
    if a[i]>c+15:
        break
    else:
        c=a[i]
c+=15
if c>90:
    c=90
print(c)

n=int(input())
l=[0]+list(map(int,input().split()))+[900]
ans=90
for i in range(1,n+2):
    if l[i]-l[i-1]>15: ans=l[i-1]+15; break
print(min(90,ans))


n = int(input())

a = list(map(int, input().split()))

ans = 0
check = False
for i in range(n):
    if a[i] - ans > 15:
        ans += 15
        check = True
        break
    else:
        ans = a[i]

if not check:
    if 90 - ans <= 15:
        ans = 90
    else:
        ans += 15

print(ans)

import sys
n=int(input())
z=list(map(int,input().split()))
z.append(91)
now=0
for i in z:
    if i-now>15:
        print(min(90, now+15))
        return
    else:
        now=i
print(90)

n = int(input())
inp = input().split()
a = []
for i in inp:
	a.append(int(i))

t = 0
i = 0
while i<n and a[i]-t<=15:
	t = a[i]
	i += 1
	
print(min(90,t+15))

n = int(input())
last = 0
for t in (int(x) for x in input().split()):
    if t-last > 15:
        break
    last = t
print(min(last+15, 90))


n=int(input())
a=[int(i) for i in input().split(' ')]
a.insert(0,0)
for i in range(1,n+1):
    if a[i]-a[i-1]>15:
        print(a[i-1]+15)
        break
else:
    print(min(a[n]+15,90))

def __starting_point():
    #n, m = list(map(int, input().split()))
    n = int(input())
    t = [0] + list(map(int, input().split()))
    ans = -1
    for i in range(1, n + 1):
        if t[i] - t[i - 1] - 1 >= 15:
            ans = i - 1;
            break;
    if ans != -1:
        print(t[ans] + 15)
    else:
        print(min(90, t[-1] + 15))
    
    
    

__starting_point()

N=int(input())
mas=[False]*90
li=list(map(int, input().split()))
for i in li:
    mas[i-1]=True
i=0
sk=0
while (sk<15) and (i<90):
    if (not mas[i]):
        sk+=1
    else:
        sk=0
    i+=1
print(i)

def solve():
	n = int(input())

	ar = list(map(int, input().split()))

	prev = 0

	for i in range(n):
		if ar[i] - prev > 15:
			print(prev + 15)
			return
		prev = ar[i]
	print(min(90, prev + 15))

solve()