#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#define maxn 20
using namespace std;
int sc[maxn];
int cre[maxn];

float GPA(int x)
{
    if(x>=90&&x<100)return 4.0;
    else if(x>=85&&x<=89)return 3.7;
    else if(x>=82&&x<=84)return 3.3;
    else if(x>=78&&x<=81)return 3.0;
    else if(x>=75&&x<=77)return 2.7;
    else if(x>=72&&x<=74)return 2.3;
    else if(x>=68&&x<=71)return 2.0;
    else if(x>=64&&x<=67)return 1.5;
    else if(x>=60&&x<=63)return 1.0;
    else return 0;

}

int main() {
    int n;
    cin>>n;
    for(int i=0;i<n;i++)cin>>cre[i];
    for(int i=0;i<n;i++)cin>>sc[i];
    double cnt1=0,cnt2=0;
    for(int i=0;i<n;i++)
    {
        cnt1 +=cre[i];
        float num = GPA(sc[i])*cre[i];
        cnt2 +=num;
    }
    // cout<<cnt1<<endl;
    // cout<<cnt2<<endl;
    double ans = cnt2*1.0/cnt1;
    printf("%.2f\n",ans);
    


}
// 64 位输出请用 printf("%lld")