#include <iostream>
#include <iomanip>
using namespace std;
int main(){
    int bags;
    cin>>bags;
    double totalweight=0.0;
    for (int i=0;i<n;i++){
        int n;
        cin >>n;
        if(n>10){
            cout<<"Too many bags";
            return 0;
        }
        for (int j=0;j<n;j++){
            double weight ;
            cin>>weight;
            if(weight<0){
                cout<<"Invalid weight";
                return 0;
            }
            totalweight+=weight;
        }
    }
    cout <<fixed <<setprecision (2)<<totalweight;
    return 0;
}