#include <iostream>
#include <vector>
using namespace std;

double getGPA(int grade) {
    if (grade >= 90) return 4.0;
    else if (grade >= 85) return 3.7;
    else if (grade >= 82) return 3.3;
    else if (grade >= 78) return 3.0;
    else if (grade >= 75) return 2.7;
    else if (grade >= 72) return 2.3;
    else if (grade >= 68) return 2.0;
    else if (grade >= 64) return 1.5;
    else if (grade >=60 ) return 1.0;
    else return 0 ;
}

int main() {
    int n;
    cin >> n;
    double totalCredit =0 , totalGrade =0 ;
    vector<int> credits(n);
    for(int i =0; i < n; i++) {
        cin >> credits[i];
        totalCredit += credits[i];
    }
    
   for(int i =0; i < n; i++) {
       int grade;
       cin >> grade;

       double exchange = getGPA(grade);
       totalGrade += exchange * credits[i];
       
       }

   printf("%.2f", totalGrade / totalCredit);

   return 0 ;
}