import java.util.*;

class Solver {

    int nbRow;
    int nbPrenoms; // le nombre de prenoms au total
    int nbGroupes; // le nombre de groupes
    
    // autres attributs (notamment pour stocker les paires de prénoms
    
    Solver(int nbRow) {
	this.nbRow = nbRow;
    }
    
    public void readParameters(Scanner scan) {
	for(int i=0;i<nbRow;i++) {
            String p1 = scan.next();
            String p2 = scan.next();

	    // stocke qqpart p1 et p2
	}
    }

    void solve() {	
	// nbGroupes = cherche le nombre de groupes
    }

    // autres methodes ??
}

class Amis {

    public static void main(String[] args) {
	
	Locale.setDefault(Locale.ENGLISH);	
        Scanner scan = new Scanner(System.in);

        int nbRow = scan.nextInt();

	Solver s = new Solver(nbRow);
	s.readParameters(scan);
	s.solve();

        System.out.println(s.nbPrenoms);
        System.out.println(s.nbGroupes);
    }
}
