#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
const int N = 20;
int n;
int key[10] = {0, 60, 64, 68, 72, 75, 78, 82, 85, 90};
double value[10] = {0, 1.0, 1.5, 2.0, 2.3, 2.7, 3.0, 3.3, 3.7, 4.0};
int grade[N], score[N];
double get(int k)
{
for (int i = 9; i >= 0; -- i)
if (k >= key[i]) return value[i];
return 0;
}
int main()
{
scanf("%d", &n);
for (int i = 0; i < n; ++ i) scanf("%d", &grade[i]);
for (int i = 0; i < n; ++ i) scanf("%d", &score[i]);
double sum = 0, cnt = 0;
for (int i = 0; i < n; ++ i)
{
sum += grade[i] * get(score[i]);
cnt += grade[i];
}
printf("%.2lf\n", sum / cnt);
return 0;
}