#include <bits/stdc++.h>
using namespace std;
int n, T[9000];
int main(int argc, char *argv[]) {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x;
    T[x] = 1;
  }
  int ans = 0, last = 0;
  for (int i = 1; i <= 90; ++i) {
    if (last == 15) break;
    ++ans;
    ++last;
    if (T[i]) last = 0;
  }
  cout << ans << endl;
  return 0;
}
