#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, a[110];
int main() {
  while (~scanf("%d", &n)) {
    a[0] = 0;
    a[n + 1] = 90;
    for (int i = 1; i <= n + 1; i++) scanf("%d", a + i);
    bool flag = true;
    for (int i = 1; i <= n + 1 && flag; i++)
      if (a[i] - a[i - 1] > 15) {
        printf("%d\n", a[i - 1] + 15);
        flag = false;
      }
    if (flag) printf("%d\n", 90);
  }
  return 0;
}
