#include <bits/stdc++.h>
int main() {
  int n, i, time = 0;
  scanf("%d", &n);
  int arr[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  arr[i] = 90;
  if (arr[0] > 15) {
    time = 15;
    printf("\n%d", time);
  } else {
    time = arr[0];
    for (i = 0; i < n; i++) {
      if ((arr[i + 1] - arr[i]) > 15) {
        time = time + 15;
        break;
      } else {
        time = time + arr[i + 1] - arr[i];
      }
    }
    printf("\n%d", time);
  }
}
