#include <bits/stdc++.h>
using namespace std;
int inter[100] = {0};
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    inter[x] = 1;
  }
  for (int i = 1; i <= 76; i++) {
    int j = i;
    int kk = 0;
    while (j <= i + 14) {
      if (!inter[j])
        kk++;
      else
        break;
      j++;
    }
    if (kk == 15) {
      cout << i + 14 << "\n";
      return 0;
    }
  }
  cout << 90 << "\n";
  return 0;
}
