#include <bits/stdc++.h>
using namespace std;
bool b[1234];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    b[x] = true;
  }
  int cnt = 0, ans;
  for (ans = 1; ans <= 90; ans++) {
    cnt++;
    if (b[ans]) cnt = 0;
    if (cnt == 15) break;
  }
  printf("%d\n", min(90, ans));
  return 0;
}
