package main
import "fmt"
func main() {
var n, first, now, ans int
fmt.Scanf("%d", &n)
first = 0;
for i:=0; i<n; i++ {
fmt.Scanf("%d", &now)
if (now > (first + 15)) {
ans = first + 15
break
} else {
first = now
ans = now + 15
}
}
if ans < 15 {
ans = 15
}
if ans > 90 {
ans = 90
}
fmt.Printf("%d", ans)
}
cGFja2FnZSBtYWluCgppbXBvcnQgImZtdCIKCmZ1bmMgbWFpbigpIHsKCXZhciBuLCBmaXJzdCwgbm93LCBhbnMgaW50CglmbXQuU2NhbmYoIiVkIiwgJm4pCgoJZmlyc3QgPSAwOwoJZm9yIGk6PTA7IGk8bjsgaSsrIHsKCQlmbXQuU2NhbmYoIiVkIiwgJm5vdykKCQlpZiAobm93ID4gKGZpcnN0ICsgMTUpKSB7CgkJCWFucyA9IGZpcnN0ICsgMTUKCQkJYnJlYWsKCQl9IGVsc2UgewoJCQlmaXJzdCA9IG5vdwoJCQlhbnMgPSBub3cgKyAxNQoJCX0KCX0KCglpZiBhbnMgPCAxNSB7CgkJYW5zID0gMTUKCX0KCWlmIGFucyA+IDkwIHsKCQlhbnMgPSA5MAoJfQoJZm10LlByaW50ZigiJWQiLCBhbnMpCn0=