#include <stdio.h>

int main(){
int grade,xf[10],xfsum=0,n;float gdsum=0;
scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&xf[i]);
		xfsum+=xf[i];
	}
	for(int i=0;i<n;i++){
		scanf("%d",&grade);
		if(grade>=90)gdsum+=4*xf[i];
		else if(grade>=85)gdsum+=3.7*xf[i];
		else if(grade>=82)gdsum+=3.3*xf[i];
		else if(grade>=78)gdsum+=3*xf[i];
		else if(grade>=75)gdsum+=2.7*xf[i];
		else if(grade>=72)gdsum+=2.3*xf[i];
		else if(grade>=68)gdsum+=2*xf[i];
		else if(grade>=64)gdsum+=1.5*xf[i];
		else if(grade>=60)gdsum+=1*xf[i];
		else gdsum+=0;
	}
	printf("%.2f",gdsum/xfsum);
	return 0;
}