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();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			}
			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();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			}
			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();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			}
			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();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			}
			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();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			}
			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();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			}
			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();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				String TaroCard = sc.next();
				String HanakoCard = sc.next();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			} {
				String TaroCard = sc.next();
				String HanakoCard = sc.next();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			} String TaroCard = sc.next(); TaroCard sc.next() sc.next sc String HanakoCard = sc.next(); HanakoCard sc.next() sc.next sc if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				} TaroCard.compareTo(HanakoCard) > 0 TaroCard.compareTo(HanakoCard) TaroCard.compareTo TaroCard HanakoCard 0 {
					TaroPoint +=3;
				} TaroPoint +=3 TaroPoint 3 if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				} HanakoCard.compareTo(TaroCard) > 0 HanakoCard.compareTo(TaroCard) HanakoCard.compareTo HanakoCard TaroCard 0 {
					HanakoPoint +=3;
				} HanakoPoint +=3 HanakoPoint 3 {
					TaroPoint ++;
					HanakoPoint ++;
				} TaroPoint ++ TaroPoint HanakoPoint ++ HanakoPoint 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();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			}
			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();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			}
			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();

				if(TaroCard.compareTo(HanakoCard) > 0) {
					TaroPoint +=3;
				}else if(HanakoCard.compareTo(TaroCard) > 0){
					HanakoPoint +=3;
				}else {
					TaroPoint ++;
					HanakoPoint ++;
				}
			}
			System.out.println(TaroPoint+" "+HanakoPoint);
		}

	}
}
