import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class NorthWest {

    public static void main(String[] args) {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s;
        String[] sep;
        try {
            while ((s = br.readLine()) != null && !s.isEmpty()) {
                int n = Integer.parseInt(s);

                Town[] towns = new Town[n];
                int maxC = 0;
                int minC = 0;

                for (int i = 0; i < n; i++) {
                    s = br.readLine();
                    sep = s.split(" ");
                    towns[i] = new Town(Integer.parseInt(sep[0]), Integer.parseInt(sep[1]));
                    if (towns[i].c > maxC) maxC = towns[i].c;
                    if (towns[i].c < minC) minC = towns[i].c;
                }

                int[] countOfTownsForC = new int[maxC+1];
                int[] negativeC = new int[Math.abs(minC)+1];



                for (Town town : towns) {
                    if (town.c >= 0) {
                        countOfTownsForC[town.c]++;
                    } else {
                        negativeC[Math.abs(town.c)]++;
                    }
                }

                int totalCount = 0;

                for (int con = minC; con <= maxC; con++) {
                    if (con >= 0) {
                        int countOnLine = countOfTownsForC[con];
                        if (countOnLine > 0) totalCount += countOnLine-1;
                    } else {
                        int countOnLine = negativeC[Math.abs(con)];
                        if (countOnLine > 0) totalCount += countOnLine-1;
                    }
                }

                System.out.println((float)totalCount/towns.length);

            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}


class Town{
    public int x;
    public int y;
    public int c;

    public Town(int x, int y) {
        this.x = x;
        this.y = y;
        this.c = this.y + this.x;
    }
}