#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
cin >> n;
double a, b, c;
int m;
double s = 0;
while (n--)
{
cin >> a >> b >> m;
c = sqrt(a * a + b * b); // 开平方根
s += c / 50 * 2 + m * 1.5;
}
cout << ceil(s); // 向上取整函数
return 0;
}