#include <bits/stdc++.h>
using namespace std;
int tu(int val) { return (1 << val); }
bool iset(int mask, int id) {
  if ((mask & tu(id)) != 0) return true;
  return false;
}
void doset(int &mask, int id) { mask |= tu(id); }
void dounset(int &mask, int id) { mask = mask & (~tu(id)); }
template <typename T>
string tos(T a) {
  stringstream ss;
  string ret;
  ss << a;
  ss >> ret;
  return ret;
}
int ar[100];
int main() {
  int n;
  while (cin >> n) {
    int v;
    memset(ar, 0, sizeof ar);
    ;
    for (int(i) = (0); (i) < (n); (i)++) {
      cin >> v;
      ar[v] = 1;
    }
    int ans = 90;
    int br = 0;
    for (int(i) = (1); (i) < (91); (i)++) {
      if (ar[i] == 0)
        br++;
      else
        br = 0;
      if (br == 15) {
        ans = i;
        break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
