#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(100, 0);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[x]++;
  }
  int now = 0;
  for (int i = 1; i <= 90; i++) {
    if (a[i] == 1)
      now = 0;
    else {
      now++;
      if (now == 15) {
        cout << i;
        return 0;
      }
    }
  }
  cout << 90;
}
