import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
while(sc.hasNext()) {
int n=sc.nextInt();
double sum=0;
double sum1=0,sum2=0;
while(n-->0) {
double a=sc.nextDouble();
double b=sc.nextDouble();
sum1+=a;
if (b>=90&&b<=100) {
sum2+=a*4;
}
if (b>=80&&b<90) {
sum2+=a*3;
}
if (b>=70&&b<80) {
sum2+=a*2;
}
if (b>=60&&b<70) {
sum2+=a*1;
}
}
sum=sum2/sum1;
if (sum1==0) {
System.out.println("-1");
}else {
System.out.println(String.format("%.2f", sum));
}
}
}
}