import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		
		int taro = 0, hanako = 0;
		for(int i = 0; i < n; i++){
			final String fst = sc.next();
			final String snd = sc.next();
			
			if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			}
		}
		
		System.out.println(taro + " " + hanako);
		
	}
} import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		
		int taro = 0, hanako = 0;
		for(int i = 0; i < n; i++){
			final String fst = sc.next();
			final String snd = sc.next();
			
			if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			}
		}
		
		System.out.println(taro + " " + hanako);
		
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		
		int taro = 0, hanako = 0;
		for(int i = 0; i < n; i++){
			final String fst = sc.next();
			final String snd = sc.next();
			
			if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			}
		}
		
		System.out.println(taro + " " + hanako);
		
	} main {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		
		int taro = 0, hanako = 0;
		for(int i = 0; i < n; i++){
			final String fst = sc.next();
			final String snd = sc.next();
			
			if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			}
		}
		
		System.out.println(taro + " " + hanako);
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int taro = 0 taro 0 hanako = 0; hanako 0 for(int i = 0; i < n; i++){
			final String fst = sc.next();
			final String snd = sc.next();
			
			if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			final String fst = sc.next();
			final String snd = sc.next();
			
			if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			}
		} {
			final String fst = sc.next();
			final String snd = sc.next();
			
			if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			}
		} final String fst = sc.next(); fst sc.next() sc.next sc final String snd = sc.next(); snd sc.next() sc.next sc if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			} fst.compareTo(snd) < 0 fst.compareTo(snd) fst.compareTo fst snd 0 {
				hanako += 3;
			} hanako += 3 hanako 3 if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			} fst.compareTo(snd) > 0 fst.compareTo(snd) fst.compareTo fst snd 0 {
				taro += 3;
			} taro += 3 taro 3 {
				taro++;
				hanako++;
			} taro++ taro hanako++ hanako System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String args[] args public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		
		int taro = 0, hanako = 0;
		for(int i = 0; i < n; i++){
			final String fst = sc.next();
			final String snd = sc.next();
			
			if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			}
		}
		
		System.out.println(taro + " " + hanako);
		
	}
} public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		
		int taro = 0, hanako = 0;
		for(int i = 0; i < n; i++){
			final String fst = sc.next();
			final String snd = sc.next();
			
			if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			}
		}
		
		System.out.println(taro + " " + hanako);
		
	}
} Main
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		
		int taro = 0, hanako = 0;
		for(int i = 0; i < n; i++){
			final String fst = sc.next();
			final String snd = sc.next();
			
			if(fst.compareTo(snd) < 0){
				hanako += 3;
			}else if(fst.compareTo(snd) > 0){
				taro += 3;
			}else{
				taro++;
				hanako++;
			}
		}
		
		System.out.println(taro + " " + hanako);
		
	}
}