#pragma GCC optimize("Ofast,unroll-loops") #include using namespace std; using Int = long long; typedef pair Pi; typedef pair Pl; constexpr int mod = 1e9+7; constexpr int INF32 = numeric_limits::max(); constexpr Int INF64 = numeric_limits::max(); #define END {cout< #define gPr(t) priority_queue,greater> #define V(t) vector #define rer(i,l,r) for(int(i)=(l); (i)<(r); ++(i)) #define rep(i,n) rer(i,0,n) #define gnr(i,l,r) for(int (i)=(r)-1; (i)>=(l); --(i)) #define pri(a) cout<<(a)<<'\n' #define pri2(a,n) {rep(i,n-1)cout< inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } int n,m,_,x,y,q; string s,sb; bool ok; char cf,cb; int main(){ cin.tie(nullptr); ios::sync_with_stdio(0); //cout<>n; rep(i,n){ cin>>m>>s; q=12*m/1000; x+=min(q,int(s.size())); y+=max(0,int(s.size()-q)); } cout<