import java.util.Scanner;

/**
 * 
 */

/**
 * @author kawakami
 *
 */
class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		String taro = "";
		String hana = "";
		String str;
		
		int i = 0;
		int num = 0;
		int tpoi = 0;
		int	hpoi = 0;
		
		num = as.nextInt();
		
		for(i=0;i<num;i++){
			
			taro = as.next();
			hana = as.next();
			
			if(hana.compareTo(taro) == 0){
				
				tpoi++;
				hpoi++;
				
			}
			else if(hana.compareTo(taro) < 0){     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			}
			else{
				
				hpoi = hpoi + 3;
				
			}
			
		}
		
		str = String.valueOf(tpoi)+" "+String.valueOf(hpoi);
		System.out.println(str);

	}

} import java.util.Scanner; Scanner java.util class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		String taro = "";
		String hana = "";
		String str;
		
		int i = 0;
		int num = 0;
		int tpoi = 0;
		int	hpoi = 0;
		
		num = as.nextInt();
		
		for(i=0;i<num;i++){
			
			taro = as.next();
			hana = as.next();
			
			if(hana.compareTo(taro) == 0){
				
				tpoi++;
				hpoi++;
				
			}
			else if(hana.compareTo(taro) < 0){     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			}
			else{
				
				hpoi = hpoi + 3;
				
			}
			
		}
		
		str = String.valueOf(tpoi)+" "+String.valueOf(hpoi);
		System.out.println(str);

	}

} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		String taro = "";
		String hana = "";
		String str;
		
		int i = 0;
		int num = 0;
		int tpoi = 0;
		int	hpoi = 0;
		
		num = as.nextInt();
		
		for(i=0;i<num;i++){
			
			taro = as.next();
			hana = as.next();
			
			if(hana.compareTo(taro) == 0){
				
				tpoi++;
				hpoi++;
				
			}
			else if(hana.compareTo(taro) < 0){     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			}
			else{
				
				hpoi = hpoi + 3;
				
			}
			
		}
		
		str = String.valueOf(tpoi)+" "+String.valueOf(hpoi);
		System.out.println(str);

	} main {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		String taro = "";
		String hana = "";
		String str;
		
		int i = 0;
		int num = 0;
		int tpoi = 0;
		int	hpoi = 0;
		
		num = as.nextInt();
		
		for(i=0;i<num;i++){
			
			taro = as.next();
			hana = as.next();
			
			if(hana.compareTo(taro) == 0){
				
				tpoi++;
				hpoi++;
				
			}
			else if(hana.compareTo(taro) < 0){     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			}
			else{
				
				hpoi = hpoi + 3;
				
			}
			
		}
		
		str = String.valueOf(tpoi)+" "+String.valueOf(hpoi);
		System.out.println(str);

	} Scanner as = new Scanner(System.in); as new Scanner(System.in) String taro = ""; taro "" String hana = ""; hana "" String str; str int i = 0; i 0 int num = 0; num 0 int tpoi = 0; tpoi 0 int	hpoi = 0; hpoi 0 num = as.nextInt() num as.nextInt() as.nextInt as for(i=0;i<num;i++){
			
			taro = as.next();
			hana = as.next();
			
			if(hana.compareTo(taro) == 0){
				
				tpoi++;
				hpoi++;
				
			}
			else if(hana.compareTo(taro) < 0){     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			}
			else{
				
				hpoi = hpoi + 3;
				
			}
			
		} i=0; i=0 i 0 i<num i num i++ i++ i {
			
			taro = as.next();
			hana = as.next();
			
			if(hana.compareTo(taro) == 0){
				
				tpoi++;
				hpoi++;
				
			}
			else if(hana.compareTo(taro) < 0){     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			}
			else{
				
				hpoi = hpoi + 3;
				
			}
			
		} {
			
			taro = as.next();
			hana = as.next();
			
			if(hana.compareTo(taro) == 0){
				
				tpoi++;
				hpoi++;
				
			}
			else if(hana.compareTo(taro) < 0){     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			}
			else{
				
				hpoi = hpoi + 3;
				
			}
			
		} taro = as.next() taro as.next() as.next as hana = as.next() hana as.next() as.next as if(hana.compareTo(taro) == 0){
				
				tpoi++;
				hpoi++;
				
			}
			else if(hana.compareTo(taro) < 0){     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			}
			else{
				
				hpoi = hpoi + 3;
				
			} hana.compareTo(taro) == 0 hana.compareTo(taro) hana.compareTo hana taro 0 {
				
				tpoi++;
				hpoi++;
				
			} tpoi++ tpoi hpoi++ hpoi if(hana.compareTo(taro) < 0){     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			}
			else{
				
				hpoi = hpoi + 3;
				
			} hana.compareTo(taro) < 0 hana.compareTo(taro) hana.compareTo hana taro 0 {     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			} tpoi = tpoi + 3 tpoi tpoi + 3 tpoi 3 {
				
				hpoi = hpoi + 3;
				
			} hpoi = hpoi + 3 hpoi hpoi + 3 hpoi 3 str = String.valueOf(tpoi)+" "+String.valueOf(hpoi) str String.valueOf(tpoi)+" "+String.valueOf(hpoi) String.valueOf(tpoi)+" "+String.valueOf(hpoi) String.valueOf(tpoi) String.valueOf String tpoi " " String.valueOf(hpoi) String.valueOf String hpoi System.out.println(str) System.out.println System.out System System.out str String[] args args
import java.util.Scanner;

/**
 * 
 */

/**
 * @author kawakami
 *
 */
class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		String taro = "";
		String hana = "";
		String str;
		
		int i = 0;
		int num = 0;
		int tpoi = 0;
		int	hpoi = 0;
		
		num = as.nextInt();
		
		for(i=0;i<num;i++){
			
			taro = as.next();
			hana = as.next();
			
			if(hana.compareTo(taro) == 0){
				
				tpoi++;
				hpoi++;
				
			}
			else if(hana.compareTo(taro) < 0){     //??±????????????????????????????????§????????´???
				
				tpoi = tpoi + 3;
				
			}
			else{
				
				hpoi = hpoi + 3;
				
			}
			
		}
		
		str = String.valueOf(tpoi)+" "+String.valueOf(hpoi);
		System.out.println(str);

	}

}