#include <bits/stdc++.h>
using namespace std;
long long power(long long aa, long long pp) {
  long long xx = 1, yy = aa % 1000000007;
  while (pp > 0) {
    if (pp & 1) xx = (xx * yy) % 1000000007;
    yy = (yy * yy) % 1000000007;
    pp = pp >> 1;
  }
  return xx % 1000000007;
}
bool cmp(pair<int, int> a, pair<int, int> b) {
  if (a.first != b.first)
    return a.first < b.first;
  else
    return a.second < b.second;
}
int xc[4] = {0, 1, 0, -1};
int yc[4] = {1, 0, -1, 0};
int A[200];
int main() {
  ios_base::sync_with_stdio(false);
  int i, n, k = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> A[i];
  A[n + 1] = 90;
  for (i = 1; i <= n + 1; i++) {
    if ((A[i] - A[i - 1] - 1) >= 15) {
      k += 15;
      break;
    } else {
      k += A[i] - A[i - 1];
    }
  }
  cout << k;
  return 0;
}
