import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){
            int taro = 0;
            int hanako = 0;

            int n = Integer.parseInt(in.readLine());
            for (int i = 0; i < n; i++) {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            }

            System.out.println(taro + " " + hanako);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
 import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){
            int taro = 0;
            int hanako = 0;

            int n = Integer.parseInt(in.readLine());
            for (int i = 0; i < n; i++) {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            }

            System.out.println(taro + " " + hanako);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} Main public static void main(String[] args) {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){
            int taro = 0;
            int hanako = 0;

            int n = Integer.parseInt(in.readLine());
            for (int i = 0; i < n; i++) {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            }

            System.out.println(taro + " " + hanako);
        } catch (IOException e) {
            e.printStackTrace();
        }
    } main {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){
            int taro = 0;
            int hanako = 0;

            int n = Integer.parseInt(in.readLine());
            for (int i = 0; i < n; i++) {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            }

            System.out.println(taro + " " + hanako);
        } catch (IOException e) {
            e.printStackTrace();
        }
    } try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){
            int taro = 0;
            int hanako = 0;

            int n = Integer.parseInt(in.readLine());
            for (int i = 0; i < n; i++) {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            }

            System.out.println(taro + " " + hanako);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            int taro = 0;
            int hanako = 0;

            int n = Integer.parseInt(in.readLine());
            for (int i = 0; i < n; i++) {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            }

            System.out.println(taro + " " + hanako);
        } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) int taro = 0; taro 0 int hanako = 0; hanako 0 int n = Integer.parseInt(in.readLine()); n Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in for (int i = 0; i < n; i++) {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            } {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            } String[] arr = in.readLine().split(" "); arr in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int cmp = arr[0].compareTo(arr[1]); cmp arr[0].compareTo(arr[1]) arr[0].compareTo arr[0] arr 0 arr[1] arr 1 if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                } cmp > 0 cmp 0 {
                    taro += 3;
                } taro += 3 taro 3 if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                } cmp == 0 cmp 0 {
                    taro++;
                    hanako++;
                } taro++ taro hanako++ hanako {
                    hanako += 3;
                } hanako += 3 hanako 3 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) {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){
            int taro = 0;
            int hanako = 0;

            int n = Integer.parseInt(in.readLine());
            for (int i = 0; i < n; i++) {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            }

            System.out.println(taro + " " + hanako);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){
            int taro = 0;
            int hanako = 0;

            int n = Integer.parseInt(in.readLine());
            for (int i = 0; i < n; i++) {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            }

            System.out.println(taro + " " + hanako);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))){
            int taro = 0;
            int hanako = 0;

            int n = Integer.parseInt(in.readLine());
            for (int i = 0; i < n; i++) {
                String[] arr = in.readLine().split(" ");
                int cmp = arr[0].compareTo(arr[1]);
                if (cmp > 0) {
                    taro += 3;
                } else if (cmp == 0) {
                    taro++;
                    hanako++;
                } else {
                    hanako += 3;
                }
            }

            System.out.println(taro + " " + hanako);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

