#include <bits/stdc++.h>
using namespace std;
int ans, x, n, s[90], i, m[91];
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    m[s[i]] = 1;
  }
  for (i = 1; i <= 90; i++) {
    if (m[i] == 0)
      x++;
    else
      x = 0;
    ans++;
    if (x == 15) break;
  }
  cout << ans << endl;
}
