#include using lint=long long; int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); std::cout.setf(std::ios_base::fixed);std::cout.precision(15); std::vectorname(5); std::vectorscore(5); for(lint i=0;i<5;i++)std::cin>>name.at(i)>>score.at(i); std::vector>count(5,std::vector(4)); lint N=1; for(lint i=0;i<3;i++){ lint n;std::cin>>n; N*=n; for(lint j=0;j>s; lint ind=std::find(name.begin(),name.end(),s)-name.begin(); count.at(ind).at(i)++; } } for(lint i=0;i<5;i++){ auto&&v=count.at(i); v.at(3)=v.at(0)*v.at(1)*v.at(2)*5; } double ans=0; for(lint i=0;i<5;i++){ ans+=score.at(i)*count.at(i).at(3); } std::cout<