import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        float GPA = 0;
        int[] credits = new int[n];
        int sum = 0;
        for (int i = 0; i < n; i++) {
            credits[i] = sc.nextInt();
            sum += credits[i];
        }
        for (int i = 0; i < n; i++) {
            GPA += credits[i] * getGPA(sc.nextInt());
        }
        System.out.printf("%.2f", GPA / sum);
    }
    private static float getGPA(int score) {
        if (score >= 90) {
            return 4.0f;
        } else if (score >= 85) {
            return 3.7f;
        } else if (score >= 82) {
            return 3.3f;
        } else if (score >= 78) {
            return 3.0f;
        } else if (score >= 75) {
            return 2.7f;
        } else if (score >= 72) {
            return 2.3f;
        } else if (score >= 68) {
            return 2.0f;
        } else if (score >= 64) {
            return 1.5f;
        } else if (score >= 60) {
            return 1.0f;
        } else {
            return 0.0f;
        }
    }
}