#include <stdio.h>

int main() {
 int n;
 scanf("%d",&n);
 float a[n],b[n],s[n],c=0,d=0,sum=0;
 for(int i=0;i<n;i++)
 {
    scanf("%f",&a[i]);
 }
  for(int i=0;i<n;i++)
 {
    scanf("%f",&b[i]);
    if(b[i]>=90&&b[i]<=100)
    s[i]=4.0;
     if(b[i]>=85&&b[i]<=89)
    s[i]=3.7;
     if(b[i]>=82&&b[i]<=84)
    s[i]=3.3;
     if(b[i]>=78&&b[i]<=81)
    s[i]=3.0;
    if(b[i]>=75&&b[i]<=77)
    s[i]=2.7;
    if(b[i]>=72&&b[i]<=74)
    s[i]=2.3;
    if(b[i]>=68&&b[i]<=71)
    s[i]=2.0;
    if(b[i]>=64&&b[i]<=67)
    s[i]=1.5;
    if(b[i]>=60&&b[i]<=63)
    s[i]=1.0;
    if(b[i]<60)
    s[i]=0;
 }
 
 for(int i=0;i<n;i++)
 {
    c=s[i]*a[i]+c;
    d=a[i]+d;
 }
sum=c/d;
printf("%.2f",sum);


    return 0;
}