N, *C = map(int, open(0).read().split()) th = sum(C) / 10 print(sum(30 for c in C if c <= th))