On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days off. Your task is to determine the minimum possible and the maximum possible number of days off per year on Mars.

Input

The first line of the input contains a positive integer n (1 ≤ n ≤ 1 000 000) — the number of days in a year on Mars.

Output

Print two integers — the minimum possible and the maximum possible number of days off per year on Mars.

Examples

Input

14


Output

4 4


Input

2


Output

0 2

Note

In the first sample there are 14 days in a year on Mars, and therefore independently of the day a year starts with there will be exactly 4 days off .

In the second sample there are only 2 days in a year on Mars, and they can both be either work days or days off.

import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;


public class Main {

    public static void main(String[] args) throws IOException {
      //  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));                                    //(new FileReader("input.in"));
       // StringBuilder out = new StringBuilder();
       // StringTokenizer tk;
      Scanner s = new Scanner(System.in);
       Reader.init(System.in);
        //tk = new StringTokenizer(in.readLine());
        int n =Reader.nextInt(), c=0,v=0;
        if(n==1) {System.out.println("0 1");System.exit(0);}
        else if(n==2){System.out.println("0 2");System.exit(0);}
        
       
        else {
             c = n/7;
            c*=2;
            v=c;
            if(n%7==1)
                c+=1;
            else if(n%7>=2)
                c+=2;
            if((n+1)%7==0)
                v++;
        
        }
        System.out.println(v+" "+c);
        
        
    }

}

//class Book {
//
//    String a;
//    int b, c,ind;
//
//    public Book(String x, int y) {
//        a = x;
//        b = y;
//        
//
//    }
//
//    @Override
//    public boolean equals(Object object) {
//        boolean sameSame = false;
//
//        if (object != null && object instanceof Book) {
//            sameSame = (this.a == null ? ((Book) object).a == null : this.a.equals(((Book) object).a));
//        }
//        if (object != null && object instanceof Book) {
//            sameSame = this.b == ((Book) object).b;
//        }
//
//        return sameSame;
//    }
//}
//
//class MyComparator implements Comparator<Book> {
//
//    @Override
//    public int compare(Book o1, Book o2) {
//        if (o1.c > o2.c) {
//            return 1;
//        } else if (o1.c < o2.c) {
//            return -1;
//        }
//        return 0;
//    }
//
//}

    
    
class Reader {

    static StringTokenizer tokenizer;
    static BufferedReader reader;

    public static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
        tokenizer = new StringTokenizer("");
    }

    public static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    public static String nextLine() throws IOException {
        return reader.readLine();
    }

    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}
