#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main() {
int n = 0, T = 0;
cin >> n;
for (int i = 0; i < n; i++)//循环,每一次救援
{
double x = 0, y = 0, p = 0;
cin >> x >> y >> p;//
double s = sqrt(x * x + y * y);//算屋顶到原点的距离
double t = (2 * s) / 50 + p*1.5;//来回各一躺+上车下车
T += ceil(t);//t向上取整
}
cout <<T<< endl;
return 0;
}