import java.util.*;
public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
    	int i, j, k;
    	int tp = 0;
    	int hp = 0;
    	int n = sc.nextInt();
    	
    	for(i = 0; i < n; i++) {
    		String taro = sc.next();
    		String hana = sc.next();
    		
    		if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		}
    	}
    	System.out.println(tp + " " + hp);
    }
} import java.util.*; util.* java public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
    	int i, j, k;
    	int tp = 0;
    	int hp = 0;
    	int n = sc.nextInt();
    	
    	for(i = 0; i < n; i++) {
    		String taro = sc.next();
    		String hana = sc.next();
    		
    		if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		}
    	}
    	System.out.println(tp + " " + hp);
    }
} Main public static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) throws Exception {
    	int i, j, k;
    	int tp = 0;
    	int hp = 0;
    	int n = sc.nextInt();
    	
    	for(i = 0; i < n; i++) {
    		String taro = sc.next();
    		String hana = sc.next();
    		
    		if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		}
    	}
    	System.out.println(tp + " " + hp);
    } main {
    	int i, j, k;
    	int tp = 0;
    	int hp = 0;
    	int n = sc.nextInt();
    	
    	for(i = 0; i < n; i++) {
    		String taro = sc.next();
    		String hana = sc.next();
    		
    		if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		}
    	}
    	System.out.println(tp + " " + hp);
    } int i i j j k; k int tp = 0; tp 0 int hp = 0; hp 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(i = 0; i < n; i++) {
    		String taro = sc.next();
    		String hana = sc.next();
    		
    		if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		}
    	} i = 0; i = 0 i 0 i < n i n i++ i++ i {
    		String taro = sc.next();
    		String hana = sc.next();
    		
    		if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		}
    	} {
    		String taro = sc.next();
    		String hana = sc.next();
    		
    		if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		}
    	} String taro = sc.next(); taro sc.next() sc.next sc String hana = sc.next(); hana sc.next() sc.next sc if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		} taro.compareTo(hana) > 0 taro.compareTo(hana) taro.compareTo taro hana 0 tp += 3 tp 3 if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		} taro.compareTo(hana) < 0 taro.compareTo(hana) taro.compareTo taro hana 0 hp += 3 hp 3 {
    			tp++;
    			hp++;
    		} tp++ tp hp++ hp System.out.println(tp + " " + hp) System.out.println System.out System System.out tp + " " + hp tp + " " + hp tp " " hp String[] args args public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
    	int i, j, k;
    	int tp = 0;
    	int hp = 0;
    	int n = sc.nextInt();
    	
    	for(i = 0; i < n; i++) {
    		String taro = sc.next();
    		String hana = sc.next();
    		
    		if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		}
    	}
    	System.out.println(tp + " " + hp);
    }
} public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
    	int i, j, k;
    	int tp = 0;
    	int hp = 0;
    	int n = sc.nextInt();
    	
    	for(i = 0; i < n; i++) {
    		String taro = sc.next();
    		String hana = sc.next();
    		
    		if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		}
    	}
    	System.out.println(tp + " " + hp);
    }
} Main
import java.util.*;
public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
    	int i, j, k;
    	int tp = 0;
    	int hp = 0;
    	int n = sc.nextInt();
    	
    	for(i = 0; i < n; i++) {
    		String taro = sc.next();
    		String hana = sc.next();
    		
    		if(taro.compareTo(hana) > 0) tp += 3;
    		else if(taro.compareTo(hana) < 0) hp += 3;
    		else {
    			tp++;
    			hp++;
    		}
    	}
    	System.out.println(tp + " " + hp);
    }
}
