import java.util.Scanner;
import java.text.DecimalFormat;
public class Main {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int n = in.nextInt();
double x,y;
int number;
double way;
double time;
int Result = 0;
for(int i=1;i<=n;i++)
{
x = in.nextDouble();
y = in.nextDouble();
number = in.nextInt();
way = Math.sqrt(x*x+y*y);
time = way/50+number+way/50+number/2;
double Time = Math.ceil(time);
int result = (int)Time;
Result = Result +result;
}
System.out.println(Result);
}
}