#include <iostream>

using namespace std;

const int MAXN = 10;
int xuefen[MAXN];
int shijidefen[MAXN];

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

int main (){
	int n;
	cin >> n;
	double sumxuefen = 0;
	double sumjidian = 0;
	for (int i = 0; i < n; i++){
		cin >> xuefen[i];
	}
	for (int i = 0; i < n; i++){
		cin >> shijidefen[i];
	}	
	for (int i = 0; i < n; i++){
		sumxuefen += xuefen[i]; 
		sumjidian += xuefen[i] * shijichengjijidian(shijidefen[i]);
	}
	printf ("%.2f\n", sumjidian / sumxuefen);
	return 0;
}

不止一点眼花缭乱