import std.stdio, std.conv, std.string, std.range, std.math, std.algorithm; void main() { auto N = readln.strip.to!int; auto C = readln.split.to!(int[]); C.map!(a => a<=C.sum/10?30:0).sum.writeln; }