#include <bits/stdc++.h>
using namespace std;
int arr[10000];
int main() {
  int n;
  cin >> n;
  arr[0] = 0;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  sort(arr, arr + n + 1);
  int last = 0;
  for (int i = 1; i <= 90; i++) {
    int f = 0;
    for (int j = 0; j <= n && arr[j] <= i; j++) {
      if (abs(arr[j] - i) < 15) {
        f = 1;
        break;
      }
    }
    if (f == 0) {
      cout << i << endl;
      exit(0);
    }
  }
  cout << 90 << endl;
}
