#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, t = 0, a[90], i;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (a[0] > 15)
    cout << 15;
  else {
    for (i = 0; i < n; i++) {
      t = a[i];
      if (a[i] + 15 < a[i + 1]) {
        break;
      }
    }
    if (t < 75)
      cout << t + 15;
    else
      cout << 90;
  }
  return 0;
}
