#include <bits/stdc++.h> using namespace std; int main(){ long long n; double x,y,p,t=0; cin>>n; for(int i=1;i<=n;++i){ cin>>x>>y>>p; t+=sqrt(x*x+y*y)/50*2+p*1.5; } cout<<ceil(t); return 0; }