#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int a[n + 5];
  a[0] = 0;
  for (int i = 1; i <= n; i++) cin >> a[i];
  a[n + 1] = 90;
  int ans = 0;
  for (int i = 1; i <= (n + 1); i++) {
    if ((a[i] - a[i - 1]) > 15) {
      ans = ans + 15;
      break;
    }
    ans = ans + a[i] - a[i - 1];
  }
  cout << ans;
}
