import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in);) {
			
			int n = sc.nextInt();
			
			int taroPoint = 0;
			int hanakoPoint = 0;
			
			for(int i = 0; i < n; i++) {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			}
			
			System.out.println(taroPoint + " " + hanakoPoint);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in);) {
			
			int n = sc.nextInt();
			
			int taroPoint = 0;
			int hanakoPoint = 0;
			
			for(int i = 0; i < n; i++) {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			}
			
			System.out.println(taroPoint + " " + hanakoPoint);
		}
	}
} Main public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in);) {
			
			int n = sc.nextInt();
			
			int taroPoint = 0;
			int hanakoPoint = 0;
			
			for(int i = 0; i < n; i++) {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			}
			
			System.out.println(taroPoint + " " + hanakoPoint);
		}
	} main {
		
		try (Scanner sc = new Scanner(System.in);) {
			
			int n = sc.nextInt();
			
			int taroPoint = 0;
			int hanakoPoint = 0;
			
			for(int i = 0; i < n; i++) {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			}
			
			System.out.println(taroPoint + " " + hanakoPoint);
		}
	} try (Scanner sc = new Scanner(System.in);) {
			
			int n = sc.nextInt();
			
			int taroPoint = 0;
			int hanakoPoint = 0;
			
			for(int i = 0; i < n; i++) {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			}
			
			System.out.println(taroPoint + " " + hanakoPoint);
		} {
			
			int n = sc.nextInt();
			
			int taroPoint = 0;
			int hanakoPoint = 0;
			
			for(int i = 0; i < n; i++) {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			}
			
			System.out.println(taroPoint + " " + hanakoPoint);
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int taroPoint = 0; taroPoint 0 int hanakoPoint = 0; hanakoPoint 0 for(int i = 0; i < n; i++) {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			} {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			} String taroCard = sc.next(); taroCard sc.next() sc.next sc String hanakoCard = sc.next(); hanakoCard sc.next() sc.next sc int result = taroCard.compareTo(hanakoCard); result taroCard.compareTo(hanakoCard) taroCard.compareTo taroCard hanakoCard if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				} result < 0 result 0 {
					hanakoPoint += 3;
				} hanakoPoint += 3 hanakoPoint 3 if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				} result == 0 result 0 {
					taroPoint++;
					hanakoPoint++;
				} taroPoint++ taroPoint hanakoPoint++ hanakoPoint {
					taroPoint += 3;
				} taroPoint += 3 taroPoint 3 System.out.println(taroPoint + " " + hanakoPoint) System.out.println System.out System System.out taroPoint + " " + hanakoPoint taroPoint + " " + hanakoPoint taroPoint " " hanakoPoint String[] args args public class Main {

	public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in);) {
			
			int n = sc.nextInt();
			
			int taroPoint = 0;
			int hanakoPoint = 0;
			
			for(int i = 0; i < n; i++) {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			}
			
			System.out.println(taroPoint + " " + hanakoPoint);
		}
	}
} public class Main {

	public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in);) {
			
			int n = sc.nextInt();
			
			int taroPoint = 0;
			int hanakoPoint = 0;
			
			for(int i = 0; i < n; i++) {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			}
			
			System.out.println(taroPoint + " " + hanakoPoint);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in);) {
			
			int n = sc.nextInt();
			
			int taroPoint = 0;
			int hanakoPoint = 0;
			
			for(int i = 0; i < n; i++) {
				String taroCard = sc.next();
				String hanakoCard = sc.next();
				
				int result = taroCard.compareTo(hanakoCard);
				
				if(result < 0) {
					hanakoPoint += 3;
				} else if(result == 0) {
					taroPoint++;
					hanakoPoint++;
				} else {
					taroPoint += 3;
				}
			}
			
			System.out.println(taroPoint + " " + hanakoPoint);
		}
	}
}
