import std.stdio;
import std.algorithm;

const int BORING = 15;
const int MATCH = 90;

void main()
{
	int n;
	int last = 0;
	
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		int x;
		
		scanf("%d", &x);
		
		if ((x - 1) - last >= BORING) {
			printf("%d\n", last + BORING);
			return;
		}
		
		last = x;
	}
	
	printf("%d\n", min(last + BORING, MATCH));
}

