#include <bits/stdc++.h>
int main() {
  int n, x, i, min = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    min += 15;
    if (min >= x)
      min = x;
    else
      break;
  }
  if (i == n) min += 15;
  if (min >= 90)
    printf("90\n");
  else
    printf("%d\n", min);
  return 0;
}
