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