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