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.

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.

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

NoteIn 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.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.NoSuchElementException;
import java.util.Objects;

public class Holidays {

    public static void main(String[] args) {
        Reader read = new Reader();

        int days = read.nextInt();
        int min;
        int max;

        if (days < 2) {
            min = 0;
            max = 1;
        } else if (days < 6) {
            min = 0;
            max = 2;
        } else if (days == 6) {
            min = 1;
            max = 2;
        } else {
            min = days / 7 * 2;
            max = days / 7 * 2;

            if (days % 7 == 6){
                min += 1;
                max += 2;
            } else if (days % 7 >= 2)
                max += 2;
            if (days % 7 == 1)
                max += 1;
        }

        System.out.print(min+" "+max);
    }

    private static class Reader {

        private final BufferedReader reader;
        private final String separator;
        private String ln;
        private String[] tokens;
        private int ptr;

        Reader(String separator, InputStream input) {
            this.reader = new BufferedReader(new InputStreamReader(input));
            this.separator = separator;
            this.ptr = -1;
        }

        Reader(String separator) { this(separator, System.in); }

        Reader() { this(" "); }

        String nextStr(){
            if (Objects.isNull(ln)) {
                try {
                    ln = reader.readLine();
                } catch (IOException e) {
                    System.out.println(e.getMessage());
                }
                if (Objects.nonNull(ln)) {
                    tokens = ln.split(separator);
                    ptr = 0;
                } else {
                    throw new NoSuchElementException("no next element");
                }

            } else if (ptr == tokens.length) {
                ln = null;
                tokens = null;
                ptr = -1;
                return nextStr();
            }

            return tokens[ptr++];
        }

        int nextInt() { return Integer.parseInt(nextStr()); }

        long nextLong() { return Long.parseLong(nextStr()); }

        double nextDouble() { return Double.parseDouble(nextStr()); }
    }
}

import java.util.*;
import java.lang.*;

public final class rev {
	static int abs(int a) {
		int res = a>0 ? a : -1*a;
		return res;
	}
	static int ArraySum(int[] ar) {
		int sum=0;
		for (int i:ar)
			sum+=i;
		return sum;
	}
	static boolean ArraySorted(int arr[], int n) {
        if (n==1 || n==0)
            return true;

        if (arr[n-1]<arr[n-2])
            return false;
        return ArraySorted(arr, n - 1);
    }
    // decimal to binary
    static long db(int n) {
    	long res=0;
    	int pow=0;
    	while(n>0) {
    		int temp=n%2;
    		res+=temp*Math.pow(10, pow);
    		pow++;
    		n/=2;
    	}
    	return res;
    }
    // binary to decimal
    static int bd(Integer n) {
    	int res=0;
    	int pow=0;
    	while(n>0) {
    		int temp=n%10;
    		if (temp==1)
    			res+=temp*Math.pow(2, pow);
    		pow++;
    		n=(n-temp)/10;
    	}
    	return res;
    }
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int q=n/7;
		int r=n%7;

		// int min=q!=0 ? q*2 : (n==6 ? 1 : 0);

		int min=q*2 + (r==6?1:0);
		int max=q*2 + (r<=1?r:2);

		System.out.println(min+" "+max);
	}
}

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;

        for(int x=0; x<6; x++){
            int tmp = 0;
            for(int y=1; y<=n; y+=7){
                if(y + x <= n){
                    tmp++;
                }
                if(y + x + 1 <= n){
                    tmp++;
                }
            }
            min = Math.min(min, tmp);
            max = Math.max(max, tmp);
        }

        System.out.println(min + " " + max);
    }
}

import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;

import static java.lang.Math.*;

public class Cf182 implements Runnable
{
	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
	public static void main(String args[]) throws Exception
	{
		new Thread(null, new Cf182(),"Main",1<<27).start();
	}

	public static long gcd(long a, long b)
	{
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}
	//  array sorting by colm
public static void sortbyColumn(int arr[][], int col)
    {

        Arrays.sort(arr, new Comparator<int[]>() {

          @Override
          public int compare(final int[] entry1,
                             final int[] entry2) {

            if (entry1[col] > entry2[col])
                return 1;
            else
                return -1;
          }
        });
    }

	// gcd

	public static long findGCD(long arr[], int n)
	{
		long result = arr[0];
		for (int i = 1; i < n; i++)
			result = gcd(arr[i], result);
		return result;
	}
	// fibonaci
	static int fib(int n)
    {
        int a = 0, b = 1, c;
        if (n == 0)
            return a;
        for (int i = 2; i <= n; i++)
        {
            c = a + b;
            a = b;
            b = c;
        }
        return b;
    }

// sort a string
    public static String sortString(String inputString)
    {

        char tempArray[] = inputString.toCharArray();

        Arrays.sort(tempArray);

        return new String(tempArray);
    }
    // pair function

    // list.add(new Pair<>(sc.nextInt(), i + 1));
    //     Collections.sort(list, (a, b) -> Integer.compare(b.first, a.first));
    private static class Pair<F, S> {

        private F first;

        private S second;

        public Pair() {}

        public Pair(F first, S second) {
            this.first = first;
            this.second = second;
        }
    }
    private static int next(ArrayList<Integer> arr, int target)
    {
        int start = 0, end = arr.size() - 1;

        int ans = -1;
        while (start <= end) {
            int mid = (start + end) / 2;

            if (arr.get(mid) <= target) {
                start = mid + 1;
            }
            else {
                ans = mid;
                end = mid - 1;
            }
        }
        return ans;
    }

    public static String LCS(char[] x, char[] y)
    {
      String[][] table= new String[x.length+1][y.length+1];
          for(int i=0;i<=x.length;i++)
          {
              for(int j=0;j<=y.length;j++)
              {
                if(i==0 || j==0)
                    table[i][j] = "";
                else if(x[i-1]==y[j-1])
                    table[i][j] = table[i-1][j-1]+Character.toString(x[i-1]);
                else
                {
                    int p = (table[i-1][j]).length();
                    int q = (table[i][j-1]).length();
                    if(p>q)
                        table[i][j] = table[i-1][j];
                    else
                       table[i][j] = table[i][j-1];
                }
            }

          }
         return table[x.length][y.length];
    }

    public static int primeFactors(long n)
    {
        int ans = -1;

        while (n%2==0)
        {
            ans = Math.max(2,ans);
            n /= 2;
        }

        for (int i = 3; i <= Math.sqrt(n); i+= 2)
        {

            while (n%i == 0)
            {
               ans = Math.max(ans,i);
                n /= i;
            }
        }

        if (n > 2)
            return (int)n;
        return ans;
    }
    static boolean isPowerOfTwo(int n)
    {
        if(n==0)
        return false;

    return (int)(Math.ceil((Math.log(n) / Math.log(2)))) ==
           (int)(Math.floor(((Math.log(n) / Math.log(2)))));
    }
	public void run()
	{
		InputReader sc = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
		int n = sc.nextInt();
	    int mod = n % 7;
		int weeks = (int) Math.floor(n / 7);
		int min = weeks * 2;
		int max = min;
		min += mod - 5 > 0 ? 1 : 0;
		max += mod > 2 ? 2 : mod;
		System.out.println(min+" "+max);
	}
}

/*Alone against all
Ahlawy UA07
*/
import java.util.*;

import java.io.*;
import java.math.BigInteger;
import javafx.util.Pair;

                      /*     #        #
                            #  #     #  #
                           #     #  #    #
                          #        #       #            */
public class codeforces {
                	/*help fun*/
static BigInteger add(BigInteger A, BigInteger B){return A.add(B);}
static BigInteger multiply(BigInteger A, BigInteger B){return A.multiply(B);}
static BigInteger div(BigInteger A, BigInteger B){return A.divide(B);}
static BigInteger sub(BigInteger A, BigInteger B){return A.subtract(B);}
static boolean prime(long a)
    {
        for(int i=2;i*i<=a;i++)
        {
            if(a%i==0)
                return false;
        }
        return true;
    }
public static int fact(int a)
{
    if(a==0)
        return 1;
    return a*fact(a-1);
}
					/*main*/
 public static void main(String[] args) throws IOException {
  Scanner read = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
  PrintWriter out=new PrintWriter(System.out);
  ArrayList<Pair<Integer,String>> arrofPair=new ArrayList<>();
  Set<Integer> T=new TreeSet<>();
//raw type  because i didn't specify the parameterized type and it become Stack<Object>
  Stack S=new Stack();
  Map<Character ,Integer>map=new HashMap<>();
  StringBuilder Str= new StringBuilder();
                  /*code*/
int a=read.nextInt();
int temp1=a/7;
int temp2=a%7;
int max=temp1*2,min=temp1*2;

if(temp2==6)
	min++;

if(temp2<2)
	max+=temp2;
else
	max+=2;
System.out.println(min+" "+max);

 }

}

import java.lang.*;
import java.util.*;

public class Solution
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);

        int n = sc.nextInt();

       int r = n/7;
       int m =n%7;

       if(m>5)
       System.out.print(r*2+1);
       else System.out.print(r*2);
       System.out.print(" ");
       if(n%7==0)
       System.out.print(r*2);
       else if(n%7==1)
       System.out.print(r*2+1);
       else
       System.out.print(r*2+2);

    }
}

import java.util.Scanner;

public class x {
    public static void main(String args[]){
        Scanner console = new Scanner(System.in);
        int n=console.nextInt();
        int weeks=n/7;

        System.out.println((weeks*2 +(n%7==6?1:0))+ " "+(weeks*2+Math.min(n%7,2)));
    }
}

//package Codeforces.Div2A_350.Code1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/*
 * some cheeky quote
 */

public class Main
{
    FastScanner in;
    PrintWriter out;

    public void solve() throws IOException
    {
        int n = in.nextInt();
        int min = (n / 7) << 1;
        int max = min + Math.min(2, n % 7);
        min += n % 7 == 6 ? 1 : 0;
        System.out.println(min + " " + max);
    }

    public void run()
    {
        try
        {
            in = new FastScanner();
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e)
        {
            e.printStackTrace();
        }
    }

    class FastScanner
    {
        BufferedReader br;
        StringTokenizer st;

        FastScanner()
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreTokens())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }
    }

    public static void main(String[] arg)
    {
        new Main().run();
    }
}

import java.util.Scanner ;
public class Holidays
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner (System.in) ;
		int n = sc.nextInt() ;
		int no = n / 7 ;

		if( n < 7 )
		{
			if( n == 0 )
			System.out.println( 0 + " " + 0 ) ;

			else if ( n == 1 )
			System.out.println( 0 + " " + 1 ) ;

			else if ( n == 6 )
			System.out.println( 1 + " " + 2 ) ;

			else
			System.out.println( 0 + " " + 2 ) ;
		}

		else
		{
			if( n % 7 == 0 )
			{
				System.out.print( 2*no + " " + 2*no ) ;
			}

			else if( n % 7 == 1 )
			{
				System.out.print( 2*no + " " + (2*no + 1) ) ;
			}

			else if ( n % 7 == 6 )
				System.out.println( (2*no +1) + " " + (2*no + 2 ) );

			else if( n % 7 >= 2 )
			{
				System.out.print( 2*no + " " + (2*no + 2) ) ;
			}
		}
	}
}

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Stack;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);

		int n = sc.nextInt() ;
		int result = (n/7)*2 ;
		int remain = n%7 ;
		if(remain==2)pw.println(result+" "+(result+2));
		else if(remain>1){
			if(remain==6)
			pw.println(result+1+" "+(result+2));
			else pw.println(result+" "+(result+2));

		}
		else pw.println(result+" "+(result+remain));

//		HashMap<Integer , Integer> x = new HashMap<Integer, Integer>();
//		int n = sc.nextInt() ;
//		int counter = 0 ;
//		for (int i = 0; i < n; i++) {
//			int curr = sc.nextInt() ;
//			if(x.containsKey(curr)){
//				x.put(curr, x.get(curr)+1) ;
//			}
//			else {
//				x.put(curr, 1) ;
//
//			}
//		}
//
//	int m = sc.nextInt() ;
//	int audio[] = new int[m] ;
//	for (int i = 0; i < audio.length; i++) {
//		audio[i] = sc.nextInt() ;
//	}
//	int sub[] = new int[m] ;
//	for (int i = 0; i < sub.length; i++) {
//		sub[i] = sc.nextInt() ;
//	}
//
//	int result = 0 ;
//	int mov =  0;
//	for(int i = 0 ; i< m ; i++){
//		int l1 = audio[i] ;
//		int l2  = sub[i] ;
//
//		int curr = 0 ;
//		if(x.containsKey(l1)){
//			curr+=(x.get(l1) * 10000001);
//
//		}
//		if(x.containsKey(l2)){
//			curr+= x.get(l2) ;
//		}
//		if(curr>result){
//			result = curr ;
//			mov = i+1 ;
//		}
//
//	}
//	pw.println(mov);
//

		pw.flush();
		pw.close();
	}
}

class Triple {
	long x, y, z;

	public Triple(long a, long b, long c) {
		x = a;
		y = b;
		z = c;
	}
}

class Pair implements Comparable<Pair> {
	int first;
	int second;

	Pair(int f, int s) {
		first = f;
		second = s;
	}
	public void add(){
		second++ ;
	}

	@Override
	public int compareTo(Pair o) {
		// TODO Auto-generated method stub
		return (first>second)? 1: first<second ? -1 : 0 ;
	}

}

class Scanner {
	StringTokenizer st;
	BufferedReader br;

	public Scanner(InputStream s) {
		br = new BufferedReader(new InputStreamReader(s));
	}

	public Scanner(FileReader f) {
		br = new BufferedReader(f);
	}

	public String next() throws IOException {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

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

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

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

	public double nextDouble() throws IOException {
		String x = next();
		StringBuilder sb = new StringBuilder("0");
		double res = 0, f = 1;
		boolean dec = false, neg = false;
		int start = 0;
		if (x.charAt(0) == '-') {
			neg = true;
			start++;
		}
		for (int i = start; i < x.length(); i++)
			if (x.charAt(i) == '.') {
				res = Long.parseLong(sb.toString());
				sb = new StringBuilder("0");
				dec = true;
			} else {
				sb.append(x.charAt(i));
				if (dec)
					f *= 10;
			}
		res += Long.parseLong(sb.toString()) / f;
		return res * (neg ? -1 : 1);
	}

	public boolean ready() throws IOException {
		return br.ready();
	}

}

import java.io.*;
import java.util.*;

public class Solution {

    private static void solve(InputReader in, OutputWriter out) {
        int n = in.nextInt();

        int min = n / 7 * 2 + (n % 7 == 6 ? 1 : 0);
        int max = n / 7 * 2 + (n % 7 > 0 ? (n % 7 == 1 ? 1 : 2) : 0);

        out.print(min + " " + max);
    }

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        solve(in, out);
        in.close();
        out.close();
    }

    private static class InputReader {
        private BufferedReader br;
        private StringTokenizer st;

        InputReader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }

        String nextLine() {
            String line = null;
            try {
                line = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return line;
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String line = nextLine();
                if (line == null) return null;
                st = new StringTokenizer(line);
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        void close() {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    private static class OutputWriter {
        BufferedWriter bw;

        OutputWriter(OutputStream os) {
            bw = new BufferedWriter(new OutputStreamWriter(os));
        }

        void print(int i) {
            print(Integer.toString(i));
        }

        void println(int i) {
            println(Integer.toString(i));
        }

        void print(long l) {
            print(Long.toString(l));
        }

        void println(long l) {
            println(Long.toString(l));
        }

        void print(double d) {
            print(Double.toString(d));
        }

        void println(double d) {
            println(Double.toString(d));
        }

        void print(boolean b) {
            print(Boolean.toString(b));
        }

        void println(boolean b) {
            println(Boolean.toString(b));
        }

        void print(char c) {
            try {
                bw.write(c);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        void println(char c) {
            println(Character.toString(c));
        }

        void print(String s) {
            try {
                bw.write(s);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        void println(String s) {
            print(s);
            print('\n');
        }

        void close() {
            try {
                bw.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

import java.util.*;
import java.io.*;
public class Holidays
{

    /************************ SOLUTION STARTS HERE ***********************/

    private static void solve(FastScanner s1, PrintWriter out){

	int n = s1.nextInt();
	int cntMin = 0, cntMax = 0;
	for(int i=1,day1 = 0,day2 = 5;i<=n;i++, day1 = (day1 + 1 )%7 , day2 = (day2 + 1) % 7){
	    if(day1 == 5 || day1 == 6)
		cntMin++;
	    if(day2 == 5 || day2 == 6)
		cntMax++;
	}
	out.print(cntMin + " " + cntMax);
    }

    /************************ SOLUTION ENDS HERE ************************/

    /************************ TEMPLATE STARTS HERE *********************/

    public static void main(String []args) throws IOException {
	FastScanner in  = new FastScanner(System.in);
	PrintWriter out =
		new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false);
	solve(in, out);
	in.close();
	out.close();
    }

    static class FastScanner{
	BufferedReader reader;
	StringTokenizer st;
	FastScanner(InputStream stream){reader=new BufferedReader(new InputStreamReader(stream));st=null;}
	String next()
	    {while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}
	     st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
	String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}
	int    nextInt()   {return Integer.parseInt(next());}
	long   nextLong()  {return Long.parseLong(next());}
	double nextDouble(){return Double.parseDouble(next());}
	char   nextChar()  {return next().charAt(0);}
	int[]  nextIntArray(int n)         {int[] arr= new int[n];   int i=0;while(i<n){arr[i++]=nextInt();}  return arr;}
	long[] nextLongArray(int n)        {long[]arr= new long[n];  int i=0;while(i<n){arr[i++]=nextLong();} return arr;}
	int[]  nextIntArrayOneBased(int n) {int[] arr= new int[n+1]; int i=1;while(i<=n){arr[i++]=nextInt();} return arr;}
	long[] nextLongArrayOneBased(int n){long[]arr= new long[n+1];int i=1;while(i<=n){arr[i++]=nextLong();}return arr;}
	void   close(){try{reader.close();}catch(IOException e){e.printStackTrace();}}
    }

    /************************ TEMPLATE ENDS HERE ************************/
}

import java.util.Scanner;
public class Holidays {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = 0, max = 0;
		if(n <= 5){
			min = 0; max = Math.min(2, n);
		}else if(n == 6){
			min = 1; max = 2;
		}else{
			int rem = n % 7;
			if(rem==6){
				min = (n/7)*2 + 1;max = (n/7)*2 + 2;
			}else{
                if(rem >= 2) rem = 2;
                min = (n/7)*2;
                max = (n/7)*2 + rem;
            }
		}
		System.out.println(min + " " + max);
		sc.close();
	}
}

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
			}
		}

		FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken() throws IOException {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					throw e;
				}
			}
			return st.nextToken();
		}

		int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(nextToken());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(nextToken());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(nextToken());
		}
	}

	private int max(int a[]) {
		int max = Integer.MIN_VALUE;
		for (int i = 0; i < a.length; i++) {
			if (max < a[i]) {
				max = a[i];
			}
		}
		return max;
	}

	Main() throws IOException {
		FastScanner in = new FastScanner();
		PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

		int n = in.nextInt();

		int w = n / 7;
		int t = n % 7;

		int min = w * 2 + remMin(t);
		int max = w * 2 + remMax(t);

		out.printf("%d %d\n", min, max);

		out.flush();
		out.close();

	}

	private int remMin(int n) {
		switch(n) {
		case 1:case 2: case 3: case 4: case 5:  return 0;
		case 6: return 1;
		case 7:return 2;
		}

		return 0;
	}

	private int remMax(int n) {
		if (n == 1) {
			return 1;
		} else if (n > 1) {
			return 2;
		}

		return 0;
	}

	public static void main(String[] args) throws IOException {
		new Main();
	}

}

import java.util.Scanner;

public class Holidays {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int weeks = n/7;
        System.out.print(weeks*2+(n%7==6?1:0)+" ");
        System.out.print(weeks*2+(n%7>=2?2:n%7));
    }
}

import java.util.*;
public class Holidays {
static Scanner input=new Scanner(System.in);
	public static void main(String[] args) {
		int n,min,max,one=0,tow=0,r,rs,count;

		n=input.nextInt();
		if(n>=7){
			r=n%7;
			rs=r;
			max=min=(n/7)*2;

			count=0;
			while(rs>0){
				if(count%2==0){
					if(rs-2<0)one++;
					else tow++;
					rs=rs-2;}
				else
					rs=rs-5;
				count++;   }
			max=max+(tow*2)+one;
			rs=r;
			count=1;
			tow=one=0;

			while(rs>0){
				if(count%2==0){
					if(rs-2<0)one++;
					else tow++;
					rs=rs-2;}
				else
					rs=rs-5;
				count++;}
		min=min+(tow*2)+one;
		}
		else{
			if(n==6){min=1; max=2;}
			else{
			if(n==1)
				max=1;
			else max=2;
			min=0;}
		}
		System.out.println(min+" "+max);

	}

}

import java.lang.reflect.Array;
import java.util.*;
import java.io.*;

public class Main {
//            File file = new File("input.txt");
//            Scanner in = new Scanner(file);
//            PrintWriter out = new PrintWriter(new FileWriter("output.txt"));
    public static void main(String[] args) {
//        Scanner in = new Scanner(System.in);
        FastReader in = new FastReader();

        int n = in.nextInt();
        int min = (n/7)*2;
        int max = (n/7)*2 + Math.min(n%7, 2);
        if(n%7>=5){
            min+= (n%7 - 5);
        }
        System.out.println(min+" "+max);

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            int count = n / 7;
            n -= count * 7;
            count *= 2;
            if (count == 0) {
                out.println(Math.max(0, n - 5) + " " + Math.min(n, 2));
            } else {
                out.println((count + Math.max(0, n - 5)) + " " + (count + Math.min(n, 2)));
            }
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        private static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.util.Scanner;

public class A_350 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		int k = n/7;
		int q = n%7;
		int max = 2*k, min = 2*k;
		if(q>0){
			max+=Math.min(2, q);
			if(q==6)
				min++;
		}
		System.out.println(min+" "+max);
		sc.close();
	}
}

import java.util.Scanner;

public class App
{
    public static void main( String[] args )
    {
        Scanner sc = new Scanner(System.in);
        Long days = sc.nextLong();
        Long minDay = 0L;
        Long maxDay = 0L;
        if (days==1){
        	maxDay = 1L;
        }else if(days<=5){
        	maxDay = 2L;
        }else if(days==6){
        	minDay = 1L;
        	maxDay = 2L;
        }else{
        	minDay = 2*((long) days/7);
        	if (days%7>=2){
        		maxDay = minDay + 2;
        	}else{
        		maxDay = minDay + (days%7);
        	}
        	if((days+1)%7==0){
        		minDay +=1;
        	}
        }
        System.out.println(minDay+" "+maxDay);
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Test {

    public static void main(String[] args) throws Throwable {
        int i, j;
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int reminder = n % 7;

        int xsmall = (reminder == 6 ? 1 : 0);
        int xbig = (reminder == 1 ? 1 : (reminder == 0 ? 0 : 2));
        System.out.println((n / 7) * 2 + xsmall);
        System.out.println((n / 7) * 2 + xbig);

    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        String next() throws IOException {

            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();

        }

        int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

/**
 * See Holidays
 *
 * @author Brian Yeicol Restrepo Tangarife
 */
public class CF670AHolidays {

	static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) throws IOException {
		int n = Integer.parseInt(in.readLine());
		int mod = n % 7;
		int weeks = (int) Math.floor(n / 7);
		int minWeekDays = weeks * 2;
		int maxWeekDays = minWeekDays;
		minWeekDays += mod - 5 > 0 ? 1 : 0;
		maxWeekDays += mod > 2 ? 2 : mod;
		out.print(minWeekDays + " " + maxWeekDays);
		out.close();
	}
}

import java.util.*;
import java.io.*;

public class A670
{

	public static void main(String[] args) throws Exception
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();

		int mod = n%7;
		int div = n/7;

		int min = n/7+(n+1)/7;
		int max = Math.min(mod,2)+div*2;

        System.out.println(min+" "+max);
	}
}

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		int minDays = n/7 * 2;
		int maxDays = minDays;
		int remainingDays = n%7;
		if(remainingDays == 1) {
			maxDays++;
		} else if(remainingDays > 1){
			maxDays += 2;
		}

		if(remainingDays == 6) {
			minDays++;
		}
		System.out.println(minDays + " " + maxDays);

	}

}

import java.util.Scanner;

public class Holidays {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int d = input.nextInt();
		input.close();
			int min = 0;
			int max = 2;
			if (d <= 7) {
				max = d <= 2 ? d : 2;
				min = d > 5 ? d - 5 : 0;
				System.out.print(min + " " + max);
			} else {
				max = 0;
				int temp = d / 7;
				int temp2 = d % 7;
				min = temp * 2 + (temp2 <= 5 ? 0 : 7 - temp2);
				int temp1 = (d - temp * 7);
				if (temp1 == 0) {
					max = temp * 2;
				} else {
					temp1 = temp1 >= 2 ? 2 : temp1;
					max = temp * 2 + temp1;
				}
				System.out.print(min + " " + max);
			}
	}

}

import java.util.*;
public class Mars{

  public static void main(String[] args) {

      Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int min=-1;
        int max=-1;
        if (n<2){
            min=0;
            max=n;
        }
        if(n>=2 && n<=5 ){
            min=0;
            max=2;
        }

        if (n>=6 ) {
            if(n%7==6){
            min =((n/7)*2) + 1;
            max =((n / 7) * 2) + 2;
        }

           else if (n % 7 > 1) {
                min = (n / 7) * 2;
                max = ((n / 7) * 2) + 2;
            }
           else if(n % 7 ==0){
                min = (n / 7) * 2;
                max = ((n / 7) * 2) ;
            }
            else if(n % 7 ==1){
                min = (n / 7) * 2;
                max = ((n / 7) * 2) +1 ;
            }
        }

      System.out.println(min+" "+max);

    }
}

import java.lang.*;
import java.util.*;
public class insomi {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int min=0,max=0;
        if(n<=2)
        {
            max=n;
        }
        else if(n<6)
        {
            max=2;
        }
        else if(n<7)
        {
            min=7-n;
            max=2;
        }
        else {
            int r=n%7;
            int q=n/7;
            min=q*2;
            if(r==6)
                min=q*2+1;
            if(r==1) {
                max = q*2 + 1;
            }
            else if(r>1) {
                max=q*2+2;
            }
            else
                max=q*2;
        }
        System.out.println(min+" "+max);

    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		int n = nextInt();
		int min = n / 7 * 2;
		if (n % 7 > 5)
			min += n % 7 - 5;
		int max = 0;
		if (n >= 1) {
			n--;
			max++;
		}
		if (n >= 1) {
			n--;
			max++;
		}
		max += n / 7 * 2;
		if (n % 7 > 5)
			max += n % 7 - 5;
		System.out.println(min+" "+max);
		pw.close();
	}
	private static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}
	private static long nextLong() throws IOException {
		return Long.parseLong(next());
	}
	private static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}
	private static String next() throws IOException {
		while (st==null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
}

import java.io.*;
import java.text.DecimalFormat;
import java.util.*;
import java.awt.Point;

public class Newbie {

    static InputReader sc = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        solver s = new solver();
        int t = 1;
        while (t > 0) {
            s.sol();
            t--;
        }
        out.close();
    }
           /* static class descend implements Comparator<pair1> {
                public int compare(pair1 o1, pair1 o2) {
                    if (o1.pop != o2.pop)
                        return (int) (o1.pop - o2.pop);
                    else
                        return o1.in - o2.in;
                }
            }*/

    static class InputReader {
        public BufferedReader br;
        public StringTokenizer token;

        public InputReader(InputStream stream) {
            br = new BufferedReader(new InputStreamReader(stream), 32768);
            token = null;
        }

        public String sn() {
            while (token == null || !token.hasMoreTokens()) {
                try {
                    token = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return token.nextToken();
        }

        public int ni() {
            return Integer.parseInt(sn());
        }

        public String snl() throws IOException {
            return br.readLine();
        }

        public long nlo() {
            return Long.parseLong(sn());
        }

        public double nd() {
            return Double.parseDouble(sn());
        }

        public int[] na(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = sc.ni();
            return a;
        }

        public long[] nal(int n) {
            long a[] = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = sc.nlo();
            return a;
        }
    }

    static class extra {

        static boolean v[] = new boolean[100001];
        static List<Integer> l = new ArrayList<>();
        static int t;

        static void shuffle(int a[]) {
            for (int i = 0; i < a.length; i++) {
                int t = (int) Math.random() * a.length;
                int x = a[t];
                a[t] = a[i];
                a[i] = x;
            }
        }

        static void shufflel(long a[]) {
            for (int i = 0; i < a.length; i++) {
                int t = (int) Math.random() * a.length;
                long x = a[t];
                a[t] = a[i];
                a[i] = x;
            }
        }

        static int gcd(int a, int b) {
            if (b == 0)
                return a;
            else
                return gcd(b, a % b);
        }

        static boolean valid(int i, int j, int r, int c) {
            if (i >= 0 && i < r && j >= 0 && j < c) {
                // System.out.println(i+" /// "+j);
                return true;
            } else {
                //  System.out.println(i+" //f "+j);
                return false;
            }
        }

        static void seive() {
            for (int i = 2; i < 101; i++) {
                if (!v[i]) {
                    t++;
                    l.add(i);
                    for (int j = 2 * i; j < 101; j += i)
                        v[j] = true;
                }
            }
        }

        static long fastexpo(long x, long y) {
            long res = 1;
            while (y > 0) {
                if ((y & 1) == 1) {
                    res *= x;
                }
                y = y >> 1;
                x = x * x;
            }
            return res;
        }

        static long lfastexpo(long x, long y, long p) {
            long res = 1;
            x = x % p;
            while (y > 0) {
                if ((y & 1) == 1) {
                    res = (res * x) % p;
                }
                y = y >> 1;
                x = (x * x) % p;
            }
            return res;
        }
    }

    static int inf = 5000013;

    static class solver {
        DecimalFormat df = new DecimalFormat("0.00000000");
        extra e = new extra();
        long mod = (long) (1000000007);

        void sol() throws IOException {
            int n = sc.ni();
            int d = n / 7;
            int min = 2 * d;
            int max = 2 * d;
            if (n % 7 != 0) {
                int t = n % 7;
                if (t < 2)
                    max += 1;
                else
                    max += 2;
            }
            if(n%7==6)
                min++;
            out.println(min + " " + max);
        }
    }
}

import java.io.IOException;
import java.util.*;

public class Main{
    public static void main (String args[]) throws IOException {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int week = n/7, day = n%7;
        System.out.println((2*week + (day==6?1:0)) + " " + (2*week+(day>1?2:day>0?1:0)));
    }
}

import java.util.Scanner;
public class Codeforces
{
    public static void main(String[] args)
    {
      Scanner s=new Scanner(System.in);
      int n=s.nextInt();
      int min=0;
      int max=0;
      if(n%7==1)
      {
          min=n/7*2;
          max=n/7*2+1;
          System.out.print(min+" "+max);
      }
      else if(n%7==0)
      {
          min=n/7*2;
          max=n/7*2;
          System.out.print(min+" "+max);
      }
      else if(n%7<=5 && n%7>1)
      {
          min=n/7*2;
          max=n/7*2+2;
          System.out.print(min+" "+max);
      }
      else
      {
          min=n/7*2+1;
          max=n/7*2+2;
          System.out.print(min+" "+max);
      }
    }
}

import java.awt.*;
import java.awt.event.*;
import java.lang.*;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main();
    }

    public Main() {
        new A().doIt();
    }
    class A{
    	void doIt(){
    		int n = sc.nextInt();
    		int a = (n / 7)*2;
    		int b = (n / 7)*2;
    		if(n % 7 == 0);
    		else if(n % 7 == 1)b = b + 1;
    		else b = b + 2;
    		if(n % 7 == 6)a = a + 1;
    		System.out.println(a+" "+b);
    	}
    }
}

import java.util.Scanner;

public class Sol {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int max = 0;
        int min = 0;
        int n = sc.nextInt();
        if (n == 1){
            System.out.print(0 + " ");
            System.out.println(1);
            return;
        }
        if(n < 6){
            System.out.print(0 + " ");
            System.out.println(2);
            return;
        }
        for(int i = 1; i <= n; i++) {
            if((i+1) % 7 == 0 && i == n) {
                min += 1;
            }
            if(i % 7 == 0){
                min += 2;
            }
            if ((i-2) % 7 == 0) {
                max += 2;
                i += 3;
            } else if ((i-1) % 7 == 0 && i == n) {
                max += 1;
            }
        }
        System.out.print(min + " ");
        System.out.println(max);
    }
}

import java.util.*;

public class Holidays
{
	public static void main(String args[])
	{
		int n,max=0,min=0;
		Scanner s=new Scanner(System.in);
		n=s.nextInt();
		if(n%7==0)
		{
			System.out.print((n/7)*2+" "+(n/7)*2);
		}
		if(n%7!=0 && n<7)
		{
			if(n>=2 && n<=5)
			{
				min=0;
				max=2;
			}
			if(n>5)
			{
				min=1;
				max=2;
			}
			if(n<2)
			{
				min=0;
				max=1;
			}
			System.out.print(min+" "+max);
		}
		if(n%7!=0 && n>7)
		{
			int no_of_weeks=n/7;
			int no_of_offs=no_of_weeks*2;
			int rem_days=n%7;
			if(rem_days>=2 && rem_days<=5)
			{
				min=0+no_of_offs;
				max=2+no_of_offs;
			}
			if(rem_days<2)
			{
				min=0+no_of_offs;
				max=1+no_of_offs;
			}
			if(rem_days>5)
			{
				min=1+no_of_offs;
				max=2+no_of_offs;
			}
			System.out.print(min+" "+max);
		}
	}
}

import java.util.Arrays;
import java.util.Scanner;
import java.util.Scanner;
public class walaa{
	    public static void main(String[] args) {
	        Scanner sc=new Scanner(System.in);
	      int x =sc.nextInt();
	      if(x==1){System.out.println("0 1"); return ;}
	      int c1 = (x/7)*2 ;
	      if(x%7==6)c1++;
	      int c2 = 2;
	      x=x-2;
	      c2+= (x/7)*2 ;
	      if(x%7==6) c2++;
	      //System.out.println(c2);
	      System.out.print(Math.min(c1, c2));
	      System.out.print(" ");
	      System.out.print(Math.max(c1, c2));
	    }
}

import java.math.*;
import java.io.*;
import java.util.*;
import java.awt.*;
public class DIV350A
{
	StringTokenizer st;
	BufferedReader in;
	PrintWriter ob;
	public static void main(String args[])throws IOException {
		new DIV350A().run();
	}
	void run()throws IOException   {
		//in=new BufferedReader(new FileReader("input.txt"));
		//ob=new PrintWriter("output.txt");
		in=new BufferedReader(new InputStreamReader(System.in));
		ob=new PrintWriter(System.out);
		solve();
		ob.flush();
	}
	void solve()throws IOException {
		read();
		int n=ni();
		if(n%7==0)
		{
			long y=n/7;
			y=y*1L*2;
			ob.println(y+" "+y);
		}
		else
		{
			long min=n/7;
			min*=2;
			long max=min;
			if(n%7==2)
				{max+=n%7;}
			else if(n%7==6)
			{
				min+=1;
				max+=2;
			}
			else if(n%7!=1)
				{
					max+=2;
					//min+=2;
				}
			else if(n%7==1)
			{
				max+=1;
			}
			else
			{
				//System.out.println("hi");
				max+=2;
			}
			ob.println(min+" "+max);
		}
	}
	void read()throws IOException  {
		st=new StringTokenizer(in.readLine());
	}
	int ni(){
		return Integer.parseInt(st.nextToken());
	}
	long nl(){
		return Long.parseLong(st.nextToken());
	}
	double nd(){
		return Double.parseDouble(st.nextToken());
	}
	String ns(){
		return st.nextToken();
	}
	char nc(){
		return st.nextToken().charAt(0);
	}
	int[] nia(int n)throws IOException {
		int a[]=new int[n];
		read();
		for(int i=0;i<n;i++){
			a[i]=Integer.parseInt(st.nextToken());
		}
		return a;
	}
	long[] nla(int n)throws IOException {
		long a[]=new long[n];
		read();
		for(int i=0;i<n;i++){
			a[i]=Long.parseLong(st.nextToken());
		}
		return a;
	}
}

import java.util.Scanner;

/**
 *
 * @author Ali Dman
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        solve(n);
        System.out.println(sum1);
        System.out.println(sum2);

    }
    public static int sum1 = 0, sum2 = 0;

    public static void solve(int n) {
        int x1 = n / 7;
        int x2 = n % 7;
        if (n==0) {
            return;
        }
        if (n==1) {
            sum2+=1;
        }
        else if (n == 7) {
            sum1 += 2;
            sum2 += 2;
        }
        else if (x1 == 0) {
            if (x2 == 6) {
                sum1 += 1;
                sum2 += 2;
            } else {
                sum2 += 2;
            }
        } else {
            sum1 += 2 * x1;
            sum2 += 2 * x1;
            solve(x2);
        }

    }

}

import java.util.Scanner;

public class Main {

    private final static Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        int n = in.nextInt();
        solve(n);
    }

    private static void solve(int n) {
        int max = n;
        int count = 0;
        int count2 = 0;
        while (n > 0) {
            for (int j = 0; n > 0 && j < 2; j++) {
                count2++;
                n--;
            }
            n -= 5;
        }
        n = max;
        while (n > 0) {
            n -= 5;
            for (int j = 0; n > 0 && j < 2; j++) {
                count++;
                n--;
            }
        }
        System.out.println(count + " " + count2);
    }

}

import java.util.Arrays;
import java.util.Comparator;
import java.util.Random;
import java.util.Scanner;

public class BearFair {
	public static void main(String[] arsd){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int q = n/7;
		int r = n%7;
		int min = q*2;
		int max = q*2;
		if(r>0){
			max++;
		}
		if(r>1){
			max++;
		}
		if(r==6){
			min++;
		}
		System.out.println(min+" "+max);

	}
}

import java.io.*;
import java.util.*;

public class Holidays {

    public static int best(int n) {
        return (n / 7) * 2 + Math.min(2, n % 7);
    }

    public static void main(String[] args) {
        try {
            InputStreamReader is = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(is);
            int n = Integer.parseInt(br.readLine());
            int bc = best(n);
            int wc = 0;
            if (n > 5) {
                wc = best(n - 5);
            }
            System.out.println(wc + " " + bc);
        } catch (Exception e) {e.printStackTrace();}
    }
}

import java.util.Scanner;

public class Q1Rubika {

    public static void main(String[] args) {
        long min, max;
        long noOfDays;
        Scanner sc = new Scanner(System.in);

        //System.out.println("Enter number of days(values from 1 to 10000)..Enter -1 to exit");
        noOfDays = sc.nextInt();
        //do {
            if (noOfDays % 7 == 6) {
                min = (noOfDays / 7) * 2 + 1;
            } else {
                min = (noOfDays / 7) * 2;
            }
            //System.out.println("Min number of holidays - " + min);
            if (noOfDays <= 2) {
                max = noOfDays;
            } else {
                if ((noOfDays - 2) % 7 == 6) {
                    max = 2 + 1 + ((noOfDays - 2) / 7) * 2;
                } else {
                    max = 2 + ((noOfDays - 2) / 7) * 2;
                }

            }
            //System.out.println("Max number of holidays - " + max);
            //System.out.println("Enter number of days");

            System.out.println(min + " " + max);
            //noOfDays = sc.nextInt();
        //} while (noOfDays != -1);
    }
}

import java.util.*;
import java.io.*;

/*
*/

public class Main{
    public static OutputStream out=new BufferedOutputStream(System.out);

    //nl-->neew line; //l-->line;  //arp-->array print;  //arpnl-->array print new line
    public static void nl(Object o) throws IOException{out.write((o+"\n").getBytes());}
    public static void l(Object o) throws IOException{out.write((o+"").getBytes());}
    public static void arp(int[] o) throws IOException{for(int i=0;i<o.length;i++) out.write((o[i]+" ").getBytes());}
    public static void arpnl(int[] o) throws IOException{for(int i=0;i<o.length;i++) out.write((o[i]+"\n").getBytes());}
    //
    static int MOD=(int)1e9+7;
    static int[][] pascal_trgl=new int[4005][4005];
    //

    public static void main(String[] args) throws IOException{
        // long sttm=System.currentTimeMillis();
        FastReader sc=new FastReader();
        int t=sc.nextInt();
        int min=(t/7)*2;
        int max=min+Math.min(2,t%7);
        if(t%7==6) min+=1;
        nl(min+" "+max);
        out.flush();
    }

    public static int nCr(int n,int r){
        return pascal_trgl[n][r]%MOD;
    }

    public static void intiTriangle(){
        for (int i = 0; i <= 4004; i++) {
			Arrays.fill(pascal_trgl[i], 0);
		}

		pascal_trgl[0][0] = 1;

		for (int i = 1; i <= 4004; i++) {
			pascal_trgl[i][0] = 1;
			for (int j = 1; j <= i; j++) {
				pascal_trgl[i][j] = (pascal_trgl[i - 1][j - 1] + pascal_trgl[i - 1][j]) % MOD;
			}
		}
    }

    public static String decToBin(long val){
        StringBuilder binstr=new StringBuilder();
        while(val>0){
            Long rem=val%2;val/=2;
            binstr.append(Long.toString(rem));
        }
        binstr.reverse();
        return new String(binstr);
    }

    public static long binToDec(String binstr){
        long ans=0;
        long mul=1;int val=0;
        int n=binstr.length();
        for(int i=0;i<n;i++){
            if(binstr.charAt(n-1-i)=='1') val=1;
            ans+=(mul*val);
            val=0;
            mul*=2;
        }
        return ans;
    }

    public static StringBuilder OR(long val1,long val2){
        StringBuilder s=new StringBuilder();
        while(val1>0 || val2>0){
            long rem1=0,rem2=0;
            if(val1>0) rem1=val1%2;
            if(val2>0) rem2=val2%2;
            val1/=2;val2/=2;
            s.append(Long.toString(Math.max(rem1,rem2)));
        }
        s.reverse();
        return s;
    }

    public static boolean dfsCycle(ArrayList<Integer>[] arrl,int[] vis,int st,int pr){
        vis[st]=1;
        int cupr=st;
        for(int elm:arrl[st]){
            if(vis[elm]==1 && elm!=pr){
                return true;
            }
            else if(vis[elm]==0 && dfsCycle(arrl, vis, elm, cupr)){
                return true;
            }
        }
        vis[st]=2;
        return false;
    }

    public static long powMOD(long n,long k){                 //n-pow(k)
        if(k==1){
            return n%MOD;
        }
        if(k==0){
            return 1;
        }
        long val=pow(n,k/2)%MOD;
        if(k%2==0)return ((val%MOD)*(val%MOD))%MOD;
        else return (((val*val)%MOD)*n)%MOD;
    }

    public static long pow(long n,long k){                 //n-pow(k)
        if(k==1){
            return n;
        }
        if(k==0){
            return 1;
        }
        long val=pow(n,k/2);
        if(k%2==0)return ((val)*(val));
        else return (((val*val))*n);
    }

    public static HashMap<Integer,Integer> lcm(int num){
        ArrayList<Integer> arrl=new ArrayList<Integer>();
        HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
        while(num%2==0){

            if(!map.containsKey(2)){
                arrl.add(2);
                map.put(2, 1);
            }
            else{
                map.put(2,map.get(2)+1);
            }
            num/=2;
        }
        for(int i=3;i*i<=num;i+=2){
            while(num%i==0){
                if(!map.containsKey(i)){
                    arrl.add(i);
                    map.put(i, 1);
                }
                else{
                    map.put(i,map.get(i)+1);
                }
                num/=i;
            }
        }
        if(num>2){
            if(!map.containsKey(num)){
                arrl.add(num);
                map.put(num, 1);
            }
            else{
                map.put(num,map.get(num)+1);
            }
        }
        return map;
    }

    static long m=998244353l;
    static long modInverse(long a,long m)
    {
        long m0 = m;
        long y = 0l, x = 1l;

        if (m == 1)
            return 0l;

        while (a > 1)
        {

            long q = a / m;

            long t = m;

            m = a % m;
            a = t;
            t = y;

            y = x - q * y;
            x = t;
        }
        if (x < 0)
            x += m0;

        return x;
    }

    public static int num_fact(int num){
        ArrayList<Integer> arr=new ArrayList<Integer>();
        int cnt=0;
        for(int i=1;i*i<=num;i++){
            if(num%i==0){
                if(i*i==num){
                    cnt+=1;
                }
                else{
                    cnt+=2;
                }
            }
        }
        return cnt;
    }

    public static void sort_inc(int[][] arr,int col){        //change dimention if req
        Arrays.sort(arr, new Comparator<int[]>() {
            public int compare(final int[] entry1,final int[] entry2) {
                if (entry1[col] < entry2[col])              //this is for dec
                    return 1;
                else if(entry1[col]==entry2[col])
                    return 0;
                else
                    return -1;
            }
        });
    }

    public static boolean prime(int n){
        for(int i=2;i*i<=n;i++){
            if(n%i==0){
                return false;
            }
        }
        return true;
    }

    static long gcd(long a, long b)
	{
	if (b == 0)
		return a;
	return gcd(b, a % b);
    }

    public static long lcmOfTwo(int a,int b){
        return a*b/gcd(a,b);
    }

}

class FastReader{
    BufferedReader br;
    StringTokenizer st;

    public FastReader(){
        br = new BufferedReader(new
                 InputStreamReader(System.in));
    }

    String next(){
        while (st == null || !st.hasMoreElements()){
            try{
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException  e){
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt(){
        return Integer.parseInt(next());
    }

    long nextLong(){
        return Long.parseLong(next());
    }

    double nextDouble(){
        return Double.parseDouble(next());
    }

    String nextLine(){
        String str = "";
        try{
            str = br.readLine();
        }
        catch (IOException e){
            e.printStackTrace();
        }
        return str;
    }
}

//Pair Task in process

// class Pair<D1,D2> extends Comparable{
//     D1 v1;
//     D2 v2;

//     Pair(D1 a,D2 b){
//         v1=a;v2=b;
//     }
// }

import java.util.Scanner;
public class MyClass {
    public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      int i,j=0,k=0,l=0,m,n,p=0;

      n=sc.nextInt();

      k=(n/7)*2;
      l=k;
      j=n%7;
      if(j==1)
      {
         l=l+1;
      }
      else if(j==6)
      {
          k=k+1;
          l=l+2;
      }

      else
      {
          if(j!=0)
          {
         l=l+2;
      }}
      System.out.print(k+" "+l);
    }
}

import java.util.*;
public class Holidays {
static Scanner input=new Scanner(System.in);
	public static void main(String[] args) {
		int n,min=0,max=0,one=0,tow=0,r,rs,count;

		n=input.nextInt();
		// if(n>=7){ no need
			r=n%7;
			rs=r;
			max=min=(n/7)*2;

			count=0;
			while(rs>0){
				if(count%2==0){
					if(rs-2<0)one++;
					else tow++;
					rs=rs-2;}
				else
					rs=rs-5;
				count++;   }
			max=max+(tow*2)+one;
			rs=r;
			count=1;
			tow=one=0;

			while(rs>0){
				if(count%2==0){
					if(rs-2<0)one++;
					else tow++;
					rs=rs-2;}
				else
					rs=rs-5;
				count++;}
		min=min+(tow*2)+one;

		/* else{
			if(n==6){min=1; max=2;}
			else{
			if(n==1)
				max=1;
			else max=2;
			min=0;}
		} no need */

		System.out.println(min+" "+max);

	}

}

import java.util.Scanner;

/**
 *
 * @author aselvarajah
 */
public class Days {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

    Scanner scanner = new Scanner(System.in);

    int day = scanner.nextInt();
	int day2 =day;
    int lessDay =0;
    int maxDay =0;

            while (day>0){
                if((day - 6) >= 0){
                    day = day-6;
                    lessDay++;
                    if((day - 1) >= 0){
                        day = day-1;
                        lessDay++;
                    }
                    else
                        break;
                }
                else
                    break;
            }

    	 if((day2 - 1) >= 0){
             day2 = day2-1;
             maxDay++;
         }
         while (day2>0){
             if((day2 - 1) >= 0){
                 day2 = day2-1;
                 maxDay++;
                 if((day2 - 6) >= 0){
                     day2 = day2-6;
                     maxDay++;
                 }
                 else
                     break;
             }
             else
                 break;
         }
         System.out.println(lessDay + " " +maxDay);

}

}

import java.util.Scanner;

public class Main {

    private final static Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        int n = in.nextInt();
        solve(n);
    }

    private static void solve(int n) {
        int max = n;
        int count = 0;
        int count2 = 0;
        for (int i = 0; n > 0 && i <= max; i++) {
            for (int j = 0; n > 0 && j < 2; j++) {
                count2++;
                n--;
            }
            for (int j = 0; n > 0 && j < 5; j++) {
                n--;
            }
        }
        n = max;
        for (int i = 0; n > 0 && i <= max; i++) {
            for (int j = 0; n > 0 && j < 5; j++) {
                n--;
            }
            for (int j = 0; n > 0 && j < 2; j++) {
                count++;
                n--;
            }
        }
        System.out.println(count + " " + count2);
    }

}

import java.util.Scanner;

/**
 * Created by yuu on 24/3/17.
 */
public class Problem670A {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int min = 2 * (n / 7) + Math.max(0, n % 7 - 5);
        int remaining = Math.max(0, n-2);
        int max;
        if (n > 2){
            max = 2 + (n-2)/7*2;
            max += Math.max(0, remaining%7 - 5);
        }
        else {
            max = n;
        }
        System.out.println(min + " " + max);
    }
}

import java.util.Scanner;
import static java.lang.System.in;
import static java.lang.System.out;
public class Test2 {

	public static void main(String[] args) {
		// TODO Auto-generated method tub
		Scanner s = new Scanner(in);
		int n = s.nextInt();
		int h = 0 ;
		int hmax = 0 ;
		int hmin =0 ;
		h = n/7;
		h = h*2;
		int b = n%7;
		if(b==0)
		{
			hmax = h;
			hmin = h;
		}
		else if(b==1)
		{
			hmax = h+1;
			hmin = h ;
		}
		else if(b==2 )
		{
			hmax = h+2 ;
			hmin = h ;
		}
		else if (b==6)
		{
			hmax = h+2 ;
			hmin = h+1 ;
		}
		else
		{
			hmax = h+2 ;
			hmin = h ;
		}
		out.print(hmin);
		out.print(" ");
		out.print(hmax);
		s.close();

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Objects;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		InputStream in = System.in;
		OutputStream out = System.out;
		InputReader reader = new InputReader(in);
		PrintWriter writer = new PrintWriter(out);
		new TaskA(writer).solve(reader);
		writer.close();
	}

	static class TaskA {

		private static final int N = 100010 * 6;
		private PrintWriter out;

		public TaskA(PrintWriter out) {
			this.out = out;
		}

		int calc(int days) {
			if (days == 1)
				return 1;
			if (days == 0)
				return 0;
			return 2;
		}

		void solve(InputReader in) {
			int n = in.nextInt();
			if (n == 1)
				printf("0 1\n");
			else if (n == 6)
				printf("1 2\n");
			else if (n > 1 && n < 6)
				printf("0 2\n");
			else
				printf("%d %d\n", n / 7 * 2 + (n % 7 == 6 ? 1 : 0), n / 7 * 2 + calc(n % 7));
		}

		void printf(String format, Object... args) {
			out.printf(format, args);
		}

	}

	static class InputReader {
		private StringTokenizer token;
		private BufferedReader reader;

		public InputReader(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}

		public String next() {
			while (Objects.isNull(token) || !token.hasMoreTokens()) {
				try {
					token = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new IllegalStateException();
				}
			}
			return token.nextToken();
		}

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

	}

}

import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner input = new Scanner (System.in);
		int N;
		while(input.hasNext())
		{
			N = input.nextInt();
			int ans = (N/7)*2;
			int Mod = N%7;
			if(Mod == 0)
				System.out.printf("%d %d\n",ans, ans);
			else if(Mod == 1)
				System.out.printf("%d %d\n",ans, ans+1);
			else if(Mod >= 2 && Mod <= 5)
				System.out.printf("%d %d\n",ans, ans+2);
			else
				System.out.printf("%d %d\n",ans+1, ans+2);
		}
	}
}

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class P670A {
  InputStream is;
  PrintWriter out;
  String INPUT = "1000000";

  void solve() {
    int n = ni();
    int min = Integer.MAX_VALUE;
    int max = Integer.MIN_VALUE;
    for (int i = 0; i < 7; i++) {
      int weekends = 0;
      for (int j = 0; j < n; j++) {
        if ((j + i) % 7  >= 5) {
          weekends++;
        }
      }
      min = Math.min(min, weekends);
      max = Math.max(max, weekends);
    }
    System.out.println(min + " " + max);
  }

  public static void main(String[] args) throws Exception {
    new P670A().run();
  }

  void run() throws Exception {
    is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
    out = new PrintWriter(System.out);

    long s = System.currentTimeMillis();
    solve();
    out.flush();
    tr(System.currentTimeMillis() - s + "ms");
  }

  private byte[] inbuf = new byte[1024];
  private int lenbuf = 0, ptrbuf = 0;

  private int readByte() {
    if (lenbuf == -1)
      throw new InputMismatchException();
    if (ptrbuf >= lenbuf) {
      ptrbuf = 0;
      try {
        lenbuf = is.read(inbuf);
      } catch (IOException e) {
        throw new InputMismatchException();
      }
      if (lenbuf <= 0)
        return -1;
    }
    return inbuf[ptrbuf++];
  }

  private boolean isSpaceChar(int c) {
    return !(c >= 33 && c <= 126);
  }

  private int skip() {
    int b;
    while ((b = readByte()) != -1 && isSpaceChar(b))
      ;
    return b;
  }

  private double nd() {
    return Double.parseDouble(ns());
  }

  private char nc() {
    return (char) skip();
  }

  private String ns() {
    int b = skip();
    StringBuilder sb = new StringBuilder();
    while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
      sb.appendCodePoint(b);
      b = readByte();
    }
    return sb.toString();
  }

  private char[] ns(int n) {
    char[] buf = new char[n];
    int b = skip(), p = 0;
    while (p < n && !(isSpaceChar(b))) {
      buf[p++] = (char) b;
      b = readByte();
    }
    return n == p ? buf : Arrays.copyOf(buf, p);
  }

  private char[][] nm(int n, int m) {
    char[][] map = new char[n][];
    for (int i = 0; i < n; i++)
      map[i] = ns(m);
    return map;
  }

  private int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private int ni() {
    int num = 0, b;
    boolean minus = false;
    while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
      ;
    if (b == '-') {
      minus = true;
      b = readByte();
    }

    while (true) {
      if (b >= '0' && b <= '9') {
        num = num * 10 + (b - '0');
      } else {
        return minus ? -num : num;
      }
      b = readByte();
    }
  }

  private long nl() {
    long num = 0;
    int b;
    boolean minus = false;
    while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
      ;
    if (b == '-') {
      minus = true;
      b = readByte();
    }

    while (true) {
      if (b >= '0' && b <= '9') {
        num = num * 10 + (b - '0');
      } else {
        return minus ? -num : num;
      }
      b = readByte();
    }
  }

  private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

  private void tr(Object... o) {
    if (!oj)
      System.out.println(Arrays.deepToString(o));
  }
}

import java.util.*;
import java.util.Map.Entry;
import java.util.*;

import java.io.*;

public class Main {
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));

		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
	static int binary(int a[],int start,int end,int number){
		start=0;
		end=a.length-1;
		int mid=0;

		while(start<=end){
			mid=end+(end-start)/2;
			if(a[mid]==number){
				return mid;
			}
			else
			if(a[mid]<number){
               start=mid+1;
			}
			else
			end=mid-1;
		}
		return 0;

	}
 static void sieve(){
	 boolean bl[]=new boolean[10001];
	 bl[0]=true;
	 bl[1]=true;
	for (int i = 2; i < bl.length; i++) {
		 bl[i]=false;
	}
   for (int i = 2; i <=Math.sqrt(10000); i++) {
	   if(bl[i]==false){
	   for (int j = i*i ;j <=10000; j=j+i) {
	           bl[j]=true;

		}

	}}

	for(int i=0;i<=100;++i){
		System.out.println(bl[i]+" "+i);
	}
	   }

	static void swap(int a[], int i, int j) {
		int temp = a[i];
		a[i] = a[j];
		a[j] = temp;
	}

	static void fill(int start, int end, int a[]) {
		for (int i = 0; i < end; ++i) {
			a[i] = scan.nextInt();
		}
	}
    static FastReader sc=new FastReader();
	static FastReader scan = new FastReader();
	static long power(long a,long b){
		return (long)(Math.log(a)/Math.log(b));
	}
	static boolean isPowerOfTwo(long n,long m)
	{
		if(n==0)
		return false;

	return (int)(Math.ceil((Math.log(n) / Math.log(m)))) ==
		   (int)(Math.floor(((Math.log(n) / Math.log(m)))));
	}
	/*H.entrySet().stream().sorted(HashMap.Entry.<Long,Long>comparingByValue().reversed()).forEach(e->{
		long k=e.getKey();
		System.out.print(k+" ");
		  });;-*/

	 /*static long pow(long n){

             while(n>0){
				 n>>=1;

			 }
	 }*/
	 //counting total bits
	 static long countBits(long number)
	 {

		 // log function in base 2
		 // take only integer part
		 return (long)(Math.log(number) /
					  Math.log(2) + 1);

	 }
	 static int gcd(int a,int b){
		 if(b==0){
			 return a;
		 }
		 return gcd(b%a,a);
	 }

	   static void check() throws Exception{

	   }
	public static void main(String[] args) throws Exception {
	 int n=scan.nextInt();
if(n%7==0){
	System.out.println(2*n/7+" "+(2*n/7));
}
else{
	int max=2*(n/7);
	if(n%7<=2){
 max+=n%7;
	}
	else{
		max+=2;
	}
   int  min=2*(n/7);
	if(n%7==6){
		min+=1;
	}
	System.out.println(min+" "+max);

}

 }

	  }

import java.io.*;
import java.util.*;
public final class round_350_a
{
    static FastScanner sc=new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out=new PrintWriter(System.out);

	public static void main(String args[]) throws Exception
	{
		int n=sc.nextInt(),min=0,max=0;
		for(int s1=1,s2=6,i=1;i<=n;i++,s1++,s2++)
		{
			if(s1==8)
			{
				s1=1;
			}
			if(s2==8)
			{
				s2=1;
			}
			if(s1==6 || s1==7)
			{
				min++;
			}
			if(s2==6 || s2==7)
			{
				max++;
			}
		}
		out.println(min+" "+max);
		out.close();
	}
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }

    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

	public String next() throws Exception {
		return nextToken().toString();
	}

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}

/**
 * @author egaeus
 * @mail sebegaeusprogram@gmail.com
 * @veredict Not sended
 * @url <https://codeforces.com/problemset/problem/670/A>
 * @category ?
 * @date 3/06/2020
 **/

import java.io.*;
import java.util.*;

import static java.lang.Integer.*;
import static java.lang.Math.*;

public class CF670A {
    public static void main(String args[]) throws Throwable {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        for (String ln; (ln = in.readLine()) != null && !ln.equals(""); ) {
            StringTokenizer st = new StringTokenizer(ln);
            int N = parseInt(st.nextToken());
            int A = N / 7, min = A * 2 + (N % 7 == 6 ? 1 : 0), max = A * 2 + Math.min(2, N % 7);
            System.out.println(min + " " + max);
        }
    }
}

import java.util.Scanner;
public class Holidays {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = 0, max = 0;
		if(n <= 5){
			min = 0; max = Math.min(2, n);
		}else if(n == 6){
			min = 1; max = 2;
		}else{
			int rem = n % 7;
			if(rem==6){
				min = (n/7)*2 + 1;max = (n/7)*2 + 2;
			}else{
                if(rem >= 2) rem = 2;
                min = (n/7)*2;
                max = (n/7)*2 + rem;
            }
		}
		System.out.println(min + " " + max);
		sc.close();
	}
}

import java.util.*;
public class Mars{

  public static void main(String[] args) {

      Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int min=-1;
        int max=-1;
        if (n<2){
            min=0;
            max=n;
        }
        if(n>=2 && n<=5 ){
            min=0;
            max=2;
        }

        if (n>=6 ) {
            if(n%7==6){
            min =((n/7)*2) + 1;
            max =((n / 7) * 2) + 2;
        }

           else if (n % 7 > 1) {
                min = (n / 7) * 2;
                max = ((n / 7) * 2) + 2;
            }
           else if(n % 7 ==0){
                min = (n / 7) * 2;
                max = ((n / 7) * 2) ;
            }
            else if(n % 7 ==1){
                min = (n / 7) * 2;
                max = ((n / 7) * 2) +1 ;
            }
        }

      System.out.println(min+" "+max);

    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Test {
    public static void main(String args[] ) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n=Integer.parseInt(line);
        int min=2*(n/7);
        int max=min;
        if(n%7==6) min++;
        if(n%7==1) max++;
        else if(n%7>1) max+=2;
        System.out.println(min+" "+max);
    }
}

import java.util.Scanner;

public class Holidays {

	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		if(n<2) {
			System.out.println(0+" "+1);
		}
		else if(n<=5&&n>=2) {
			System.out.println(0+" "+2);
		}else if(n==6) {
			System.out.println(1+" "+2);
		}else {
			int res= n/7;
			res*=2;
			int res2 =res;
			if(n%7==1)
				res2++;
			if(n%7==6)
				res++;
			if(n%7>=2)
				res2+=2;
			System.out.println(res+" "+res2);

		}

	}

}

import java.util.Scanner;

public class Holidays {
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		int n= sc.nextInt();
		int min= (n/7)*2;
		int max= min+Math.min(n%7,2);
		if(n%7==6)
			min++;
		System.out.println(min+ " "+max);
	}

}

import java.util.*;
public class Holidays {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),min=0,max=0;
		min= n/7 *2 + Math.max(0, n%7 -5);
		max=n/7 *2 +Math.min(2, n%7);
		System.out.println(min+" "+max);

	}

}

import java.util.Scanner;
public class MyClass {
    public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      int i,j=0,k=0,l=0,m,n,p=0;

      n=sc.nextInt();

      k=(n/7)*2;
      l=k;
      j=n%7;
      if(j==1)
      {
         l=l+1;
      }
      else if(j==6)
      {
          k=k+1;
          l=l+2;
      }

      else
      {
          if(j!=0)
          {
         l=l+2;
      }}
      System.out.print(k+" "+l);
    }
}

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int min = 0;
        int max = 1;
        if(n>1){
            max++;
        }
        if(n>5){
            min++;
            if(n>6){
                min++;
            }
        }
        if(n>7){
            int ad1 = 0;
            int ad2 = 0;
            if(n%7==1)
                ad2 = 1;
            else if(n%7>1){
                ad2 = 2;
                if(n%7==6)
                    ad1++;
            }
            min+=2*((n-7)/7)+ad1;
            max+=2*((n-7)/7)+ad2;
        }
        System.out.print(min+" "+max);
    }
}

import java.util.Scanner;

public class New {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanS = new Scanner(System.in);

		int n;
		int result;
		int max;
		int min;
		n = scanS.nextInt();
		result = n / 7;
		if (n % 7 == 0)
			System.out.println(result * 2 + " " + result * 2);

		else if (n % 7 == 1)
			System.out.println(result * 2 + " " + (result * 2 + 1));
		else if (n % 7 == 2)
			System.out.println(result * 2 + " " + (result * 2 + 2));
		//else if (n % 7 == 3)
		//	System.out.println(result * 2 + " " + (result * 2 + 2));
		else if (n % 7 == 6)
			System.out.println((result * 2+1) + " " + (result * 2 + 2));
		else
			System.out.println((result *2 ) + " " + (result * 2 + 2));

	}

}

import java.util.Scanner;

public class x {
    public static void main(String args[]){
        Scanner console = new Scanner(System.in);
        int n=console.nextInt();
        int weeks=n/7;

        System.out.println((weeks*2 +(n%7==6?1:0))+ " "+(weeks*2+Math.min(n%7,2)));
    }
}

import java.util.Scanner;

public class Holidays {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int min, max;
        int weeks = n / 7;

        if(n > 1 && n <= 5) {
            min = 0;
            max = 2;
        } else if(n == 1){
            min = 0;
            max = 1;
        } else {
            if(n % 7 == 6){
                min = (weeks * 2) + 1;
            } else {
                min = (weeks * 2);
            }
            if(n % 7 == 1){
                max = min + 1;
            } else if(n % 7 >= 2) {
                if (n % 7 == 6) {
                    max = min + 1;
                } else {
                    max = min + 2;
                }
            } else {
                max = min;
            }
        }
        System.out.println(min + " " + max);
    }
}

import java.util.*;

public class Holidays
{
	public static void main(String args[])
	{
		int n,max=0,min=0;
		Scanner s=new Scanner(System.in);
		n=s.nextInt();
		if(n%7==0)
		{
			System.out.print((n/7)*2+" "+(n/7)*2);
		}
		if(n%7!=0 && n<7)
		{
			if(n>=2 && n<=5)
			{
				min=0;
				max=2;
			}
			if(n>5)
			{
				min=1;
				max=2;
			}
			if(n<2)
			{
				min=0;
				max=1;
			}
			System.out.print(min+" "+max);
		}
		if(n%7!=0 && n>7)
		{
			int no_of_weeks=n/7;
			int no_of_offs=no_of_weeks*2;
			int rem_days=n%7;
			if(rem_days>=2 && rem_days<=5)
			{
				min=0+no_of_offs;
				max=2+no_of_offs;
			}
			if(rem_days<2)
			{
				min=0+no_of_offs;
				max=1+no_of_offs;
			}
			if(rem_days>5)
			{
				min=1+no_of_offs;
				max=2+no_of_offs;
			}
			System.out.print(min+" "+max);
		}
	}
}

import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import java.util.Map.*;
public class codeforces {
     static long count =0;
     static boolean f=false;
     static int [] arr;
	static 	PrintWriter pw=new PrintWriter(System.out);
	static void solve(int index , int mask) {
		if(index==arr.length) {
			int sum1=0; int sum2=0;
			for(int i=0;i<arr.length;i++) {
				if((mask & 1<<i)!=0) sum1+=arr[i];

			}
			return;
		}
		solve(index+1, mask | 1<<index);
		solve(index+1, mask);
	}
	public static void main(String [] args) throws IOException, InterruptedException {
		Scanner sc=new Scanner(System.in);
		int x=sc.nextInt();
		pw.print((x/7)*2+Math.max(0,(x%7)-5)+" "+((x/7)*2+Math.min(2, x%7)));
		pw.flush();
		pw.close();
	}

	static class pair implements Comparable<pair>{
		String  name; int x,y ;
		public pair(String name , int x) {
			this.name=name; this.x=x;
		}

		public pair (int x,int y) {
			this.x=x; this.y=y;
		}
		public int compareTo(pair o) {
			if(!name.equals(o.name))
				return name.compareTo(o.name);
			return x-o.x;
		}
		public String toString() {
			return name +" "+x;
		}
	}

   static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

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

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	}

import java.util.*;
public class Holiday{
    public static void main(String[] args){
        Scanner sc= new Scanner(System.in);
        int n= sc.nextInt();
        int div= n/7;
        int rem= n%7;
        if(n==1) {System.out.println("0 1"); return;}
        if(rem==0) System.out.println(2*div+" "+2*div);
        else if (rem<2) System.out.println(2*div+" "+(2*div+1));
        else if (rem<=5) System.out.println(2*div+" " +(2*div+2));
        else System.out.println((2*div+1)+" "+(2*div+2));
    }
}

import java.util.ArrayList;
import java.util.Scanner;

public class App {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		int x = 0;
		long temp = 0;
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int min=0;
		int max=0;

		if(n%7==6 && (n-2)%7==6){
		min=(int)((n/7))*2+1;
		max=(int)(((n-2)/7)*2)+1+2;}

		else if(n%7==6 && (n-2)%7!=6){
			min=(int)((n/7))*2+1;

			max=(int)(((n-2)/7)*2)+2;

		}
		else if(n%7!=6 && (n-2)%7==6){
			min=(int)((n/7))*2;

			max=(int)(((n-2)/7)*2)+2+1;

		}
		else if(n!=1 && n%7!=6 && (n-2)%7!=6)
		{
			min=(int)((n/7))*2;

			max=(int)(((n-2)/7)*2)+2;

		}

		else if(n==1){
			min=0;
			max=1;
		}

		System.out.println(min+" "+max);

}
}

import java.util.Scanner;

/**
 *
 * @author Krolos
 */
public class AHolidays {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner k = new Scanner(System.in);
        int n = k.nextInt();
        int ans1 = 0;
        int ans2 = 0;
        int m=0;
        if (n >= 2) {
            if (n / 7 > 0) {
                m = (n / 7) * 2;
                if(n%7==6){
                    ans1=m+1;
                }
                else{
                    ans1=m;
                }
                if (n % 7 >= 2) {
                    ans2 = m + 2;
                } else if (n % 7 == 1) {
                    ans2 = m + 1;
                } else {
                    ans2 = m;
                }

            } else {
                if(n==6){
                    ans1=1;
                }
                else{
                ans1 = 0;
                }
                ans2 = 2;
            }
        } else {
            if (n == 1) {
                ans1 = 0;
                ans2 = 1;
            } else {
                ans1 = 0;
                ans2 = 0;
            }
        }
        System.out.println(ans1 + " " + ans2);

        // TODO code application logic here
    }

}

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min, max;
		min = n/7*2;
		max = n/7*2;
		int t = n%7;
		if(t != 0){
			if(7-n%7 < 2)
				min += 7-n%7;
			else
				min += 0;
			max += Math.min(2, n%7);
		}
		System.out.println(min + " " + max);
	}
}

import java.io.*;
import java.util.*;

public class Problems {

    public static void main(String[] args) throws IOException {

        new Problems().run();
    }

    public void run() throws IOException{
    	Scanner sc = new Scanner(System.in);
		int days = sc.nextInt();

		if (days == 1) {
			System.out.print(0 + " " + 1);
		} else if(days <= 5) {
			System.out.print(0 + " " + 2);
		} else if(days == 6) {
			System.out.print(1 + " " + 2);
		} else {
			int kaldyk = Math.min(2, days % 7);
			int max = (days/7) * 2 + kaldyk;
			int min = (days/7) * 2 + Math.max(0, (days%7 - 5));
			System.out.println(min + " " + max);
		}
        sc.close();
    }

}

import java.util.*;
public class Marsiane
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int a = (n / 7)*2;
int b = (n / 7)*2;
a += Math.min(2,(n % 7));
b += Math.max(0,(n % 7)-5);
System.out.println(b + " " + a);
}
}

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

/**
 * Created by gaurav on 5/5/2016.
 */
public class Holidays {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String line = reader.readLine();
        int n = Integer.parseInt(line);

        int r = n % 7;
        int w = n / 7;

        int min = w * 2;
        int max = w * 2;
        int r1 = 0;
        int r2 = 0;

        if (r > 1) {
            r1 = 2;
        } else {
            r1 = r;
        }

        if (r == 6) {
            r2 = 1;
        } else {
            r2 = 0;
        }

        min += r2;
        max += r1;

        System.out.println(min + " " + max);
    }
}

import java.util.*;
public class Mars{

  public static void main(String[] args) {

      Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int min=-2;
        int max=-1;
        if (n<2){
            min=0;
            max=n;
        }
        if(n>=2 && n<=5 ){
            min=0;
            max=2;
        }

        if (n>=6 ) {
            if(n%7==6){
            min =((n/7)*2) + 1;
            max =((n / 7) * 2) + 2;
        }

           else if (n % 7 > 1) {
                min = (n / 7) * 2;
                max = ((n / 7) * 2) + 2;
            }
           else if(n % 7 ==0){
                min = (n / 7) * 2;
                max = ((n / 7) * 2) ;
            }
            else if(n % 7 ==1){
                min = (n / 7) * 2;
                max = ((n / 7) * 2) +1 ;
            }
        }

      System.out.println(min+" "+max);

    }
}

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int numDays = s.nextInt();
        getHolidays(numDays);
    }

    private static void getHolidays(int numDays) {
        if (numDays % 7 == 0) {
            int holidays = (numDays / 7) * 2;
            System.out.println(holidays + " " + holidays);
        } else {
            int numWeeks = (int) Math.floor(numDays / 7);
            int minHolidays = numWeeks * 2;
            if (numDays % 7 == 6) {
                minHolidays += 1;
            }
            int remainderDays = Math.min(2, numDays % 7);
            int maxHolidays = numWeeks*2 + remainderDays;
            System.out.println(minHolidays + " " + maxHolidays);
        }
    }
}

import java.util.Scanner;

public class Sol {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int max = 0;
        int min = 0;
        int n = sc.nextInt();
        if (n == 1){
            System.out.print(0 + " ");
            System.out.println(1);
            return;
        }
        if(n < 6){
            System.out.print(0 + " ");
            System.out.println(2);
            return;
        }
        for(int i = 1; i <= n; i++) {
            if((i+1) % 7 == 0 && i == n) {
                min += 1;
            }
            if(i % 7 == 0){
                min += 2;
            }
            if ((i-2) % 7 == 0) {
                max += 2;
                i += 3;
            } else if ((i-1) % 7 == 0 && i == n) {
                max += 1;
            }
        }
        System.out.print(min + " ");
        System.out.println(max);
    }
}

import java.util.Scanner;

public class Main {

    private final static Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        int n = in.nextInt();
        solve(n);
    }

    private static void solve(int n) {
        int max = n;
        int count = 0;
        int count2 = 0;
        for (int i = 0; n > 0 && i <= max; i++) {
            for (int j = 0; n > 0 && j < 2; j++) {
                count2++;
                n--;
            }
            for (int j = 0; n > 0 && j < 5; j++) {
                n--;
            }
        }
        n = max;
        for (int i = 0; n > 0 && i <= max; i++) {
            for (int j = 0; n > 0 && j < 5; j++) {
                n--;
            }
            for (int j = 0; n > 0 && j < 2; j++) {
                count++;
                n--;
            }
        }
        System.out.println(count + " " + count2);
    }

}

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

public class Holidays {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        PrintWriter printWriter = new PrintWriter(System.out);
        int res = 0;
        int min = t / 7 * 2;
        min += (t%7 / 6);
        if (t % 7 == 0) {
            res = t / 7 * 2;
        } else {
            int dif = t % 7;
            res = t / 7 * 2;
            if (dif == 1) {
                res += 1;
            } else if (dif >= 2){
                res += 2;
            }
        }
        printWriter.println(min + " " + res);
        printWriter.flush();
    }
}

import java.util.Scanner;
public class Holidays {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = 0, max = 0;
		if(n <= 5){
			min = 0; max = Math.min(2, n);
		}else if(n == 6){
			min = 1; max = 2;
		}else{
			int rem = n % 7;
			if(rem==6){
				min = (n/7)*2 + 1;max = (n/7)*2 + 2;
			}else{
                if(rem >= 2) rem = 2;
                min = (n/7)*2;
                max = (n/7)*2 + rem;
            }
		}
		System.out.println(min + " " + max);
		sc.close();
	}
}

import java.util.Scanner;

public class Main{

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int div = n / 7;
        int mod = n % 7;
        int min = 0, max = 0;
        if (div > 0 && mod == 0) {
            min = div * 2;
            max = min;
        } else if (div > 0 && (mod > 0)) {
            if (mod > 5) {
                min = div * 2 + 1;
                max = 2 + div * 2;
            } else if (mod == 1) {
                min = div * 2;
                max = 1 + div * 2;
            } else {
                min = div * 2;
                max = 2 + div * 2;
            }
//            min = div * 2 + (mod % 2);
//            max = mod + div * 2;
        } else if (div == 0 && mod > 0) {
            if (mod > 5) {
                min = 1;
                max = 2;
            } else if (mod == 1) {
                //mod = 2;
                min = 0;
                max = 1;
            } else {
                min = 0;
                max = 2;
            }
        }

        System.out.println(min + " " + max);

    }
}

import java.io.*;
import java.util.*;
import java.util.stream.*;

public class solution{

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter pw = new PrintWriter(System.out);

	public static void main(String[] args) throws IOException {
		int n = Integer.parseInt(br.readLine());
		int m = n % 7;
		int w = (int) Math.floor(n / 7);

		int minWD = w * 2;
		int maxWD = minWD;

		minWD += m - 5 > 0 ? 1 : 0;
		maxWD += m > 2 ? 2 : m;
		pw.print(minWD + " " + maxWD);
		pw.close();
	}
}

import java.util.Scanner;

public class Test
{
    static int minNumber = 0;
    static int maxNumber = 0;

    public static void main(String[] args)
    {

        Scanner scanner = new Scanner(System.in);
        int numberofDays = scanner.nextInt();

        int x = numberofDays % 7;
        if (x == 0)
        {
            zero(numberofDays);
        }
        else
        {
            lessThanWeek(x);

            if (numberofDays > 7)
            {
                zero(numberofDays - x);
            }
        }
        System.out.println(minNumber + " " + maxNumber);
    }

    private static void zero(int x)
    {
        int offDays = (x / 7) * 2;
        minNumber += offDays;
        maxNumber += offDays;
    }

    private static void lessThanWeek(int x)
    {
        if (x <= 2)
        {
            maxNumber = x;
        }
        else
        {
            if (x == 6)
                minNumber = 1;
            maxNumber = 2;
        }
    }

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Test {
    public static void main(String args[] ) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n=Integer.parseInt(line);
        int min=2*(n/7);
        int max=min;
        if(n%7==6) min++;
        if(n%7==1) max++;
        else if(n%7>1) max+=2;
        System.out.println(min+" "+max);
    }
}

import java.util.*;

public class solution {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		if(n%7==0) {
			System.out.print(2*n/7+" "+2*n/7);
		}
		else {
			int min=2*(n/7);
			int max=2*(n/7);
			if(n%7>5) {
				min+=(n%7 - 5);
				max+=2;
			}
			else {
				if(n%7<3) {
					max+=(n%7);
				}
				else {
					max+=2;
				}
			}
			System.out.print(min +" "+max);
		}
		sc.close();
	}
}

import java.util.*;

public class Compete {

	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt();
		int temp = 0;
		int max = 0;
		int min = 0;
		for(int i = 0; i < n; i++) {
				temp++;
				if(temp > 7) {
					temp = 1;
				}
				if(temp == 6 || temp == 7) {
					min++;
				}
		}
		temp = 5;
		for(int i = 0; i < n; i++) {
			temp++;
			if(temp > 7) {
				temp = 1;
			}
			if(temp == 6 || temp == 7) {
				max++;
			}
		}
		System.out.println(min + " " + max);
	}

}

import java.io.*;
import java.util.*;

public class Main {

    static StringBuilder data = new StringBuilder();
    final static FastReader in = new FastReader();

    public static void main(String[] args) {
        int n=in.inT();
       int max=(n/7)*2+(n%7>2?2:n%7);
       int min=(n/7)*2+(n%7==6?1:0);
        System.out.println(min+" "+max);

    }

    static void fileOut(String s) {
        File out = new File("output.txt");
        try {
            FileWriter fw = new FileWriter(out);
            fw.write(s);
            fw.flush();
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        public FastReader(String path) {
            try {
                br = new BufferedReader(new
                        InputStreamReader(new FileInputStream(path)));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int inT() {
            return Integer.parseInt(next());
        }

        long lonG() {
            return Long.parseLong(next());
        }

        float floaT() {
            return Float.parseFloat(next());
        }

        double doublE() {
            return Double.parseDouble(next());
        }

        String line() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

import java.util.Scanner;

/**
 * Created by phil on 5/5/2016.
 */
public class Holidays {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);

        int numDays = 0;
        int minDaysOff = 0;
        int maxDaysOff = 0;

        numDays = sc.nextInt();
        minDaysOff = 2*(numDays/7);
        maxDaysOff = 2*(numDays/7);

        if (numDays%7 == 1) {
            maxDaysOff++;
        }

        else if (numDays%7 >= 2) {
            maxDaysOff += 2;
            if (numDays%7 == 6) {
                minDaysOff++;
            }
        }

        System.out.println(minDaysOff + " " + maxDaysOff);
    }
}

import java.util.Arrays;
import java.util.Scanner;
import java.util.Scanner;
public class walaa{
	    public static void main(String[] args) {
	        Scanner sc=new Scanner(System.in);
	      int x =sc.nextInt();
	      if(x==1){System.out.println("0 1"); return ;}
	      int c1 = (x/7)*2 ;
	      if(x%7==6)c1++;
	      int c2 = 2;
	      x=x-2;
	      c2+= (x/7)*2 ;
	      if(x%7==6) c2++;
	      //System.out.println(c2);
	      System.out.print(Math.min(c1, c2));
	      System.out.print(" ");
	      System.out.print(Math.max(c1, c2));
	    }
}

/**
 *
 */

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

/**
 * @author rohit
 *
 */
public class C670_A {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		IOHelper ioh = new IOHelper();

		int n = ioh.nextInt();
		if(n ==1){
			System.out.println("0 1");
		} else {
			int min = n/7;
			min = min*2;
			int max = min;

			if(n%7 !=0){
				max += 2;
			}
			System.out.println(min + " " + max);
		}
	}

	private static class IOHelper {
		private InputStreamReader isr = new InputStreamReader(System.in);
		private BufferedReader br = new BufferedReader(isr);
		private StringTokenizer tokenizer;

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

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

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

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

}

//package CodeForces.Round350;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Created by ilya on 05.05.16.
 */

public class A670 {
    public static void main(String[] args) {
        sc sc = new sc();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n =sc.nextInt();
        int l = n/7;
        if (l == 0 && n > 5) out.println(1 + " "+ 2);
        else if (n%7 == 0) out.println(2*l +" " +(2*l));
        else if (n%7 == 1) out.println(2*l +" "+ (2*l+1));
        else if (n%7 >= 2) out.println(2*l +" "+ (2*l+2));

        out.close();
    }

    public static class sc {
        BufferedReader br;
        StringTokenizer st;

        public sc() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        Integer nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

import java.io.*;
import java.util.*;

public class R350A {
	public static void main(String[] args) throws IOException {
		Scanner s = new Scanner(System.in);
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

		int n = s.nextInt();
		int min=0, max=0;
		if(n%7==0) {
			min = n%5;
			System.out.println(min + " "+ min);
			return;
		}
		int dup2=n;
		while(dup2>0) {
			if(dup2>0) {
				if(dup2>2) max+=2;
				else max+=dup2;
			}
			dup2-=7;
		}
		int dup=n;
		while(dup>0) {
			dup-=5;
			if(dup>0) {
				if(dup>2) min+=2;
				else min+=dup;
				dup-=2;
			}
		}
		System.out.println(min+" "+max);

	}
}

import java.util.*;
public class Holidays {
static Scanner input=new Scanner(System.in);
	public static void main(String[] args) {
		int n,min,max;
		n=input.nextInt();
		if(n>=5){
		max=n%5;
		min=max;
		}
		else{
			if(n==1)
				max=1;
			else max=2;
			min=0;
		}
		System.out.println(min+" "+max);

	}

}

import java.util.*;
import java.io.*;

public class A670
{

	public static void main(String[] args) throws Exception
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();

		int mod = n%7;
		int div = n/7;

		int min = n/7+n/6;
		int max = Math.min(mod,2)+div*2;

        System.out.println(min+" "+max);
	}
}

import java.util.*;
import java.awt.geom.*;
import java.io.*;
import java.math.*;

public class Main
{

  public static void main(String[] args)
  {
    long startTime = System.nanoTime();
    int n=in.nextInt();
    int min=0;
    int max=0;
    if(n%7==0)
    {
        min=2*(n/7);
        max=2*(n/7);
    }
    else
    {
        min=2*(n/7);
        max=2*(n/7)+2;
    }
    out.println(min + " " + max);
    long endTime = System.nanoTime();
    err.println("Execution Time : +" + (endTime-startTime)/1000000 + " milli secs");
    exit(0);
  }

  static class InputReader
  {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

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

    static void exit(int a)
    {
      out.close();
      err.close();
      System.exit(a);
    }

    static InputStream inputStream = System.in;
    static OutputStream outputStream = System.out;
    static OutputStream errStream = System.err;
    static InputReader in = new InputReader(inputStream);
    static PrintWriter out = new PrintWriter(outputStream);
    static PrintWriter err = new PrintWriter(errStream);

}

import java.util.Scanner;
public class Holidays {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int min = 0, max = 0;
		if(n <= 5){
			min = 0; max = Math.min(2, n);
		}else if(n == 6){
			min = 1; max = 2;
		}else{
			if(n % 7 == 0){
				min = 2 * ( n / 7);
				max = min;
			}else{
				min = (n % 7 > 5) ? (2 + n / 7) : (1 + n / 7);
				max = min + Math.min(2, n % 7);
			}
		}
		System.out.println(min + " " + max);
		sc.close();
	}
}

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

public class Holidays {

	public static void main(String[] args) {

		BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(System.in));

		try {
			int days=Integer.parseInt(bufferedReader.readLine());

			int ans;

			if (days<=2) {
				System.out.println("0 "+days);
			}

			else if (days>2 && days<7) {
				System.out.println("0 "+2);
			}

			else  {
				if (days%7==0) {
					int val=(days/7)*2;
					System.out.println(val+" "+val);
				}

				else {
					int val=(days/7)*2;
					days%=7;
					if (days<=2) {
						System.out.println(val+" "+(val+days));
					}

					else if (days>2 && days<7) {
						System.out.println(val+" "+(2+val));
					}
				}

			}

		} catch (Exception e) {
			// TODO: handle exception
		}

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Objects;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		InputStream in = System.in;
		OutputStream out = System.out;
		InputReader reader = new InputReader(in);
		PrintWriter writer = new PrintWriter(out);
		new TaskA(writer).solve(reader);
		writer.close();
	}

	static class TaskA {

		private static final int N = 100010 * 6;
		private PrintWriter out;

		public TaskA(PrintWriter out) {
			this.out = out;
		}

		int calc(int days) {
			if (days == 1)
				return 1;
			if (days == 0)
				return 0;
			return 2;
		}

		void solve(InputReader in) {
			int n = in.nextInt();
			if (n == 1)
				printf("0 1\n");
			else if (n > 1 && n < 7)
				printf("0 2\n");
			else
				printf("%d %d\n", n / 7 * 2, n / 7 * 2 + calc(n % 7));
		}

		void printf(String format, Object... args) {
			out.printf(format, args);
		}

	}

	static class InputReader {
		private StringTokenizer token;
		private BufferedReader reader;

		public InputReader(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}

		public String next() {
			while (Objects.isNull(token) || !token.hasMoreTokens()) {
				try {
					token = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new IllegalStateException();
				}
			}
			return token.nextToken();
		}

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

	}

}

import java.util.Scanner;

public class JavaApplication2
{

    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        int max=0;
        if(n%7==0)
        {
            System.out.println(n/7*2+" "+(n/7*2));
            return;
        }
        for(int i=0;n>0;i++)
        {
            if(i%2==0)
            {
                max++;
                n-=2;
            }
            else
                n-=5;
        }
        System.out.println(max*2-2 + " "+(max*2));
    }

}

import java.io.*;
import java.nio.charset.Charset;
import java.util.*;
//@Author

public class Main {
    public static void main(String[] args) {
        Charset charset = Charset.forName("ascii");
        FastIO sc = new FastIO(System.in, System.out, charset);
        int n = sc.readInt();
        int mod = n % 7;
        int div = n / 7;
        if (n == 1) {
            System.out.println(0 + " " + 1);
            sc.flush();
            System.exit(0);
        }
        if (n == 2) {
            System.out.println(0 + " " + 2);
            sc.flush();
            System.exit(0);
        }
        if (n == 6) {
            System.out.println(1 + " " + 2);
        }
        if (n > 2 && n < 6) {
            System.out.println(0 + " " + 2);
            sc.flush();
            System.exit(0);
        }
        if (n % 7 == 0) {
            System.out.println((2 * div) + " " + (2 * div));
            sc.flush();
            System.exit(0);
        }
        if (n % 7 != 0) {
            int ans = (n - mod) / 7;
            if (mod == 6) {
                ans++;
            }
            int max = ans;
            if (mod == 1) max++;
            if (mod >= 2 && mod < 6) max += 2;
            System.out.println(ans + " " + max);
            sc.flush();
        }
    }
}

class FastIO {
    public final StringBuilder cache = new StringBuilder(1 << 20);
    private final InputStream is;
    private final OutputStream os;
    private final Charset charset;
    private StringBuilder defaultStringBuf = new StringBuilder(1 << 8);
    private byte[] buf = new byte[1 << 13];
    private int bufLen;
    private int bufOffset;
    private int next;

    public FastIO(InputStream is, OutputStream os, Charset charset) {
        this.is = is;
        this.os = os;
        this.charset = charset;
    }

    public FastIO(InputStream is, OutputStream os) {
        this(is, os, Charset.forName("ascii"));
    }

    private int read() {
        while (bufLen == bufOffset) {
            bufOffset = 0;
            try {
                bufLen = is.read(buf);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            if (bufLen == -1) {
                return -1;
            }
        }
        return buf[bufOffset++];
    }

    public void skipBlank() {
        while (next >= 0 && next <= 32) {
            next = read();
        }
    }

    public int readInt() {
        int sign = 1;

        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+' ? 1 : -1;
            next = read();
        }

        int val = 0;
        if (sign == 1) {
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                next = read();
            }
        } else {
            while (next >= '0' && next <= '9') {
                val = val * 10 - next + '0';
                next = read();
            }
        }

        return val;
    }

    public long readLong() {
        int sign = 1;

        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+' ? 1 : -1;
            next = read();
        }

        long val = 0;
        if (sign == 1) {
            while (next >= '0' && next <= '9') {
                val = val * 10 + next - '0';
                next = read();
            }
        } else {
            while (next >= '0' && next <= '9') {
                val = val * 10 - next + '0';
                next = read();
            }
        }

        return val;
    }

    public double readDouble() {
        boolean sign = true;
        skipBlank();
        if (next == '+' || next == '-') {
            sign = next == '+';
            next = read();
        }

        long val = 0;
        while (next >= '0' && next <= '9') {
            val = val * 10 + next - '0';
            next = read();
        }
        if (next != '.') {
            return sign ? val : -val;
        }
        next = read();
        long radix = 1;
        long point = 0;
        while (next >= '0' && next <= '9') {
            point = point * 10 + next - '0';
            radix = radix * 10;
            next = read();
        }
        double result = val + (double) point / radix;
        return sign ? result : -result;
    }

    public String readString(StringBuilder builder) {
        skipBlank();

        while (next > 32) {
            builder.append((char) next);
            next = read();
        }

        return builder.toString();
    }

    public String readString() {
        defaultStringBuf.setLength(0);
        return readString(defaultStringBuf);
    }

    public int readLine(char[] data, int offset) {
        int originalOffset = offset;
        while (next != -1 && next != '\n') {
            data[offset++] = (char) next;
            next = read();
        }
        return offset - originalOffset;
    }

    public int readString(char[] data, int offset) {
        skipBlank();

        int originalOffset = offset;
        while (next > 32) {
            data[offset++] = (char) next;
            next = read();
        }

        return offset - originalOffset;
    }

    public int readString(byte[] data, int offset) {
        skipBlank();

        int originalOffset = offset;
        while (next > 32) {
            data[offset++] = (byte) next;
            next = read();
        }

        return offset - originalOffset;
    }

    public char readChar() {
        skipBlank();
        char c = (char) next;
        next = read();
        return c;
    }

    public void flush() {
        try {
            os.write(cache.toString().getBytes(charset));
            os.flush();
            cache.setLength(0);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public boolean hasMore() {
        skipBlank();
        return next != -1;
    }
}

import java.util.Scanner;

public class Sol {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if(n < 7){
            System.out.print(0 + " ");
            System.out.println(2);
            return;
        }
        int m = 0;
        for(int i = 0; i < n; i+=7) {
            m += 2;
        }
        if(n % 7 != 0){
            System.out.println(m -2+ " ");
        }
        else {
            System.out.print(m + " ");
        }
        System.out.println(m);
    }
}

import java.util.Scanner;
public class Holidays_Mars {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int days = scanner.nextInt();

		//int days = 15;
		int min=0,max=0;
		int weeks = days/7;
		//int shortweek = days%7;

		if((days&7)==0){
			min =weeks*2;
			max =weeks*2;
		}else{
			if(days<6){
				if(days<=2){
					min = 0;
					max = 2;
				}else{
					min=0;
					max=2;
				}
			}else if(days==6){
				min = 1;
				max = 2;
			}else{
				min = weeks*2;
				max = weeks*2;
			}
		}
		System.out.print(min+ " " +max);
	}
}

//package CodeForces.Round350;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Created by ilya on 05.05.16.
 */

public class A670 {
    public static void main(String[] args) {
        sc sc = new sc();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n =sc.nextInt();
        int l = n/7;
        if (l == 0 && n > 5) out.println(1 + " "+ 1);
        else if (n%7 == 0) out.println(2*l +" " +(2*l));
        else if (n%7 == 1) out.println(2*l +" "+ (2*l+1));
        else if (n%7 >= 2) out.println(2*l +" "+ (2*l+2));

        out.close();
    }

    public static class sc {
        BufferedReader br;
        StringTokenizer st;

        public sc() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        Integer nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}

import java.util.*;

public class holidays {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int days = scan.nextInt();
		int min = 0;
		int max = 0;
		if (days < 7) {
			if (days == 1) {
				max = 1;
				min = 0;
			} else if (days > 1 && days < 6) {
				max = 2;
				min = 0;
			} else if (days == 6) {
				max = 2;
				min = 1;
			}
		} else {
			if (days % 7 == 0) {
				min = (days / 7) * 2;
				max = (days / 7) * 2;
			} else {
				int c = 0;
				if ((days + 2) % 7 >= 2) {
					c = 2;
				} else if ((days + 2) % 7 == 1) {
					c = 1;
				}
				min = (days / 7) * 2 + (c) - 2;

				if (days % 7 >= 2) {
					max = ((days / 7)+1) * 2;
				} else if (days % 7 == 1) {
					max = (days / 7) * 2 + 1;
				} else if (days % 7 == 0) {
					max = (days / 7) * 2 + 2;
				}
			}
		}
		System.out.print(min + " " + max);
	}
}

import java.util.Scanner;

/**
 *
 * @author USER
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int day = sc.nextInt();
        int max = 0;
        int min = 0;
        int carry = day / 7;

        int note = day - (carry * 7);

        if (carry == 0 || carry == 1) {
            if (day == 7) {
                min = 2;
            } else if (day <= 5) {
                min = 0;
            } else {
                min = 1;
            }
            System.out.print(min + " ");
            if(day>=2){
                 System.out.print(2);
            } else  System.out.print(1);

        } else {
            //min
            int memo = 0;
            if (note > 5) {
                memo = 7 - note;
            }
            if (note == 0) {
                System.out.print(carry * 2 + " ");
            } else {
                System.out.print((carry) * 2 + memo + " ");
            }
            // max
            memo = 0;
            if (note <= 2) {
                memo = note;
            }
            if (note == 0) {
                System.out.print(carry * 2);
            } else {
                System.out.print((carry+1) * 2 + memo);
            }

        }

    }

}

import java.math.*;
import java.util.*;

public class CP {
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt();
		int ans = 0;
		double parker = 0.0;
		if(n <= 7) {
			if(n == 1) {
				ans = 1;
				System.out.println("0 1");
			} else {
				ans = 2;
				if(n > 5) {
					System.out.println("1 2");
				} else {
					System.out.println("0 2");
			}
			}
		} else if (n % 7 == 0) {
			ans = (n / 7) * 2;
			System.out.println(ans + " " + ans);
		} else {
			parker = (double) Math.floor(n / 7) * 2;
			System.out.println(parker - 1 + " " + parker);
		}
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author niko
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int min = 0, max = 0;
            if (n % 7 == 0) {
                out.println("0");
                min = (n / 7) * 2;
                out.print(min + " " + min);
            } else if (n % 7 == 1) {
                min = (n / 7) * 2;
                max = ((n / 7) * 2) + 1;
                out.print(min + " " + min);
            } else {
                min = (n / 7) * 2 + 1;
                max = ((n / 7) * 2) + 2;
                out.println("2");
                out.print(min + " " + max);
            }

        }

    }

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar;
        private int snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

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

/**
 *
 * @author Code Forces.  Solution by: L.Azuaje.
 *
 * Problem: 670A  Holidays.
 *
 * Used at Codeforces: #350 Div-2.
 *
 */

public class Main {
	public static void main(String[] args) throws IOException {
		MyScanner scanner = new MyScanner();
		PrintStream out = System.out;

		int n = scanner.nextInt();

		int x =  n % 7;
		if (x > 2) {
		    x = 2;
        }

        out.format("%d %d", (n * 2) / 7 , (n * 2) / 7 + x );

		scanner.close();
		out.close();
	}

	// -----------MyScanner class for faster input----------
	public static class MyScanner {
		BufferedReader reader;

		public MyScanner() {
			this.reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public void close() throws IOException {
			this.reader.close();
		}

		int nextInt() {
			return Integer.parseInt(this.next());
		}

		long nextLong() {
			return Long.parseLong(this.next());
		}

		double nextDouble() {
			return Double.parseDouble(this.next());
		}

		String next() {
			String str = "";
			try {
				str = this.reader.readLine().trim();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		String[] nextStringArray() {
			String[] str = null;
			try {
				str = this.reader.readLine().trim().split(" ");
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		int[] nextIntArray() {
			String[] data  = nextStringArray();
			int[] a  = new int[data.length];

			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(data[i]);
			}

			return a;
		}

		Integer[] nextIntegerArray() {
			String[] data  = nextStringArray();
			Integer[] a  = new Integer[data.length];

			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(data[i]);
			}

			return a;
		}

		long[] nextLongArray() {
			String[] data  = nextStringArray();
			long[] a  = new long[data.length];

			for (int i = 0; i < a.length; i++) {
				a[i] = Long.parseLong(data[i]);
			}

			return a;
		}
	}
}

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int numDays = s.nextInt();
        getHolidays(numDays);
    }

    private static void getHolidays(int numDays) {
        if (numDays < 7) {
            System.out.println(numDays < 2 ? 0 + " " + numDays : 0 + " " + 2);
        } else if (numDays % 7 == 0) {
            int holidays = (numDays / 7) * 2;
            System.out.println(holidays + " " + holidays);
        } else {
            int numWeeks = (int)Math.floor(numDays/7);
            int minHolidays = numWeeks*2;
            int remainderDays  = Math.min(2,numDays%7);
            int maxHolidays = minHolidays+remainderDays;
            System.out.println(minHolidays+" "+maxHolidays);
        }
    }
}

import java.util.Scanner;

public class Holidays {

	public static void main(String[] args) {

		Scanner sc = new Scanner (System.in) ;

		int days = sc.nextInt() ;

		int minholidays = (days / 7) * 2 ;
		if(days == 6)
			minholidays = 1 ;
		int maxholidays = minholidays ;

		if(days % 7 != 0)
			if(days % 7 == 1|| days == 6)
				maxholidays = minholidays + 1;
			else
				maxholidays = minholidays + 2 ;

		System.out.println(minholidays + " " + maxholidays) ;

	}

}

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
       int days=scan.nextInt();
        int min=(days/7)*2;
        int max=2+((days-2)/7)*2;
        System.out.println(min+" "+max);

    }
}

import java.util.*;
public class Holiday
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
if(n % 7 == 0)
{
    System.out.println(((n/7)*2) + " " + ((n / 7)*2));
}
else
{
    int a = (n/7)*2;
    int b = ((n/7)*2)+1;
    System.out.println(a + " " + b);
}
}
}

import java.io.*;
import java.util.*;
public class file
{
   public static void main(String args[])throws IOException
   {
      BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
      long n = Long.parseLong(reader.readLine());
      long min=0,max=0;
      min=2*(n/7);
      max=min+((n%7)<=2?(n%7):2);
      System.out.println(min+" "+max);
   }
}

import java.util.Scanner;

public class Holidays_670A {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int val = n/7;
        n = n%7;
        val = val*2;
        System.out.print(val + " ");
        if(n >=2) {
            val = val + 2;
        } else {
            val = val+n;
        }
        System.out.println(val);
    }
}

import java.util.*;

public class fcb {
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int min=0;
		int max=0;

		if(n<7)
		{
			min = 0;
			max = 2;
		}

		if(n%7==0)
		{
			min = n/7 *2;
			max = n/7 * 2;

		}

		if(n%7!=0 && n>7)
		{
			min = n/7 *2;
			max = n/7 *2 + (n%7)/2;
		}

		System.out.println(min+" "+max);

	}

}

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

/**
 *
 * @author Code Forces.  Solution by: L.Azuaje.
 *
 * Problem: 670A  Holidays.
 *
 * Used at Codeforces: #350 Div-2.
 *
 */

public class Main {
	public static void main(String[] args) throws IOException {
		MyScanner scanner = new MyScanner();
		PrintStream out = System.out;

		int n = scanner.nextInt();

		int x =  n % 7;
		if (x > 2) {
		    x = 2;
        }

        out.format("%d %d", (n  / 7) * 2 , (n  / 7) * 2 + x );

		scanner.close();
		out.close();
	}

	// -----------MyScanner class for faster input----------
	public static class MyScanner {
		BufferedReader reader;

		public MyScanner() {
			this.reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public void close() throws IOException {
			this.reader.close();
		}

		int nextInt() {
			return Integer.parseInt(this.next());
		}

		long nextLong() {
			return Long.parseLong(this.next());
		}

		double nextDouble() {
			return Double.parseDouble(this.next());
		}

		String next() {
			String str = "";
			try {
				str = this.reader.readLine().trim();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		String[] nextStringArray() {
			String[] str = null;
			try {
				str = this.reader.readLine().trim().split(" ");
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		int[] nextIntArray() {
			String[] data  = nextStringArray();
			int[] a  = new int[data.length];

			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(data[i]);
			}

			return a;
		}

		Integer[] nextIntegerArray() {
			String[] data  = nextStringArray();
			Integer[] a  = new Integer[data.length];

			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(data[i]);
			}

			return a;
		}

		long[] nextLongArray() {
			String[] data  = nextStringArray();
			long[] a  = new long[data.length];

			for (int i = 0; i < a.length; i++) {
				a[i] = Long.parseLong(data[i]);
			}

			return a;
		}
	}
}

import java.io.*;
import java.util.StringTokenizer;

/**
 * @author maxkrivich
 */
public final class Main {

    static Integer i = new Integer(500000);

    private void solve()

    {
        int n = in.nextInt();
        int k = n % 7;
        if (k >= 1 && k <= 2) {
            out.print(n / 7 * 2 + " " + (n / 7 * 2 + k));
            return;
        } else if (k!=0){
            out.print(n / 7 * 2 + " " + (n / 7 * 2 + 2));
            return;
        } else if (k<=5){
            out.print(n/7*2+" "+(n/7*2));
        } else{
            out.print((n/7*2+7-k)+" "+(n/7*2));
        }
    }

    //    -------------I/O-------------    \\
    void run() {
        try {
            in = new FScanner(new File("input.txt"));
            out = new PrintWriter(new BufferedWriter(new FileWriter(new File("output.txt"))));
            solve();
            out.close();
            in.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    void runIO() {
        in = new FScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        solve();
        out.close();
        in.close();
    }

    public static void main(String[] args) {
        new Main().runIO();
    }

    private FScanner in;
    private PrintWriter out;

    class FScanner {

        private BufferedReader br;
        private StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException ex) {
                ex.printStackTrace();
            }
        }

        void useString(String s) {
            if (s != null) {
                st = new StringTokenizer(s);
            }
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }

        void close() {
            try {
                br.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }

    }
}

import java.util.Scanner;
import java.util.*;
import java.io.*;
import java.math.*;

//********************************************************K.S.J_@@@@@@@@@@@@@@@@@@@@@@@@@****************************

public class MArs{
	static BufferedReader reader;
    static StringTokenizer tokenizer;

	static void init(InputStream input) {reader = new BufferedReader(new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
	static String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { tokenizer = new StringTokenizer(reader.readLine() );}
        return tokenizer.nextToken();
    }
	static String nextLine() throws IOException { return  next();}
	static int nextInt() throws IOException {return Integer.parseInt( next() );}
	static double nextDouble() throws IOException {return Double.parseDouble( next() );}
	static long nextLong() throws IOException {return Long.parseLong( next() );}
	static BigInteger nextBigInteger() throws IOException {return new BigInteger(next()) ;}

	public static void main(String args[]) throws IOException{
		init(System.in);
			int T=nextInt();

			if(T%7==0){
			System.out.println((2*(T/7))+" "+(2*(T/7)));
			}
			else{
				int min=(2*(T/7));

				if(T%7>=2)
				System.out.println((min+(int)((T%7)/5))+" "+(min+2));
				else
				System.out.println(min+" "+(min+1));

			}

			}

}

import java.util.*;

public class problem670A
{
	private static Scanner in = new Scanner(System.in);
	private static int n = 0, min = 0, max = 0;
	public static void main(String[] args)
	{
		n = in.nextInt();
		if (n == 1) { min = 0; max = 1; }
		else if (n % 7 == 0) min = max = (n / 7) * 2;
		else
		{
			min = ((n - (n % 7)) / 7) * 2;
			max = min + 2;
		}
		System.out.println(min + " " + max);
	}
}

import java.util.Scanner;

public class Main {

	public static int maxDia( int dia)
	{
		if (dia ==1)
		{
			return 1;
		}
		else if (dia ==2)
			return 2;
		else
			return 0;

	}
	public static int minDia (int dia)
	{
//		if(dia ==1 ||dia ==2 ||dia ==3||dia ==4||dia ==5)
//			return 0;
//		else
		if (dia ==6)
			return 1;
		else if (dia ==7)
			return 2;
		else
			return 0 ;
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int nDiv = n/7;
		int nMod =n%7;

		int min = (nDiv*2) + minDia(nMod);
		int max = (nDiv*2 )+ maxDia(nMod);
		System.out.println(min + " "+max);
	}

}

import java.util.Scanner;

public class Holidays {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in) ;
		int d = input.nextInt() ;
		input.close();
		int min = 0 ;
		int max = 2 ;
		if(d <= 7){
			max = d <= 2 ? d : 2 ;
			min = d > 5 ? d - 5 : 0 ;
			System.out.print(min + " " + max);
		}else {
			max = 0 ;
			int temp =  d / 7  ;
			min = temp * 2 ;
			int temp1 = (d - temp * 7) % 5 ;
			if(temp1 == 0){
				max = temp * 2  ;
			}else {
				temp1 = temp1 >= 2 ? 2 : temp1 ;
				max = temp * 2 + temp1 ;
			}
			System.out.print(min + " " + max);
		}
	}

}

import java.util.*;
import java.io.*;

public class A670
{

	public static void main(String[] args) throws Exception
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();

		int mod = n%7;
		int div = n/7;

		int min = n/7+n/6;
		int max = Math.min(mod,2)+div*2;

        System.out.println(min+" "+max);
	}
}

import java.util.Scanner;

public class Test
{
    static int minNumber = 0;
    static int maxNumber = 0;

    public static void main(String[] args)
    {

        Scanner scanner = new Scanner(System.in);
        int numberofDays = scanner.nextInt();

        int x = numberofDays % 7;
        if (x == 0)
        {
            zero(numberofDays);
        }
        else
        {
            lessThanWeek(x);

            if (numberofDays > 7)
            {
                zero(numberofDays - x);
            }
        }
        System.out.println(minNumber + " " + maxNumber);
    }

    private static void zero(int x)
    {
        int offDays = (x / 7) * 2;
        minNumber += offDays;
        maxNumber += offDays;
    }

    private static void lessThanWeek(int x)
    {
        if (x <= 2)
        {
            minNumber +=0;
            maxNumber += x;
        }
        else
        {
            minNumber += 0;
            maxNumber += 2;
        }
    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            int count = n / 7;
            n -= count * 7;
            count *= 2;
            if (count == 0) {
                out.println(Math.max(0, n - 5) + " " + Math.min(n, 2));
            } else {
                if (n == 6) {
                    count += 1;
                    n -= 1;
                }
                out.println(count + " " + (count + Math.min(2, n)));
            }
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        private static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.math.*;
import java.util.*;

public class CP {
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt();
		if(n <= 7) {
			System.out.println("0 2");
		} else if (n % 7 == 0) {
			int ans = (n / 7) * 2;
			System.out.println(ans + " " + ans);
		} else {
			double ans = (double) Math.floor(n / 7) * 2;
			System.out.println(ans - 1 + " " + ans);
		}
	}
}

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

public class Ideone
{
	public static void main (String[] args)
	{
		int d,a,h,l,r;

		Scanner in= new Scanner (System.in);
		 a=in.nextInt();
		d=a/7;
		l=2*d;
		r=a%7;
		h=l;
		if(r>=2)
		h=h+2;
		else if(r==1)
		h=h+1;
		System.out.println(l);
			System.out.println(h);

	}
}

import java.util.Scanner;
public class main {
    public static void main(String args[]) throws Exception {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if(n<=7){
            System.out.println("0 2");
        }
        else{
            int g = n/7;
            int r = g*2;
            int f = g*2 + (n-g*7);
            System.out.println(r+" "+f);
        }

    }
}

import java.lang.*;
import java.util.*;

public class Solution
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);

        int n = sc.nextInt();

       int r = n/7;
       int m =n%7;

       if(m>5)
       System.out.print(1);
       else System.out.print(r*2);
       System.out.print(" ");
       if(n%7==0)
       System.out.print(r*2);
       else if(n%7==1)
       System.out.print(r*2+1);
       else
       System.out.print(r*2+2);

    }
}

import java.util.Scanner;
public class HelloWorld
{
    public static void main(String []args)
    {
        int y, mind, maxd, m, mod;
        Scanner in= new Scanner(System.in);
        y = in.nextInt();
        if (y == 1)
        {
            mind = 0;
            maxd = 1;
        }
        else if (y <= 5 && y >= 2)
        {
            mind = 0;
            maxd = 2;
        }
        else if (y == 6)
        {
            mind = 1;
            maxd = 2;
        }
        else if (y == 7)
        {
            mind = 2;
            maxd = 2;
        }
        else
        {
            mod  = y % 7;
    		m    = y / 7;
    		maxd = m * 2;
            mind = m * 2;
            if(mod == 1)
    		{
    			maxd = m*2+1;
            }
            else if(mod == 2)
            {
    			maxd = m*2+2;
            }
            else if(mod >= 3)
            {
    			maxd = m*2+2;
            }
        }
        System.out.print(mind + " " + maxd);
    }
}

import java.util.*;
public class Mars{

  public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int min=-1;
        int max=-1;
        if (n<2){
            min=0;
            max=n;
        }
        if(n>=2 && n<=5 ){
            min=0;
            max=2;
        }
        if(n==6){
            min =1;
            max =2;
        }
        if (n>=7) {
            if (n % 7 > 1) {
                min = (n / 7) * 2;
                max = ((n / 7) * 2) + 2;
            }
            if(n % 7 ==0){
                min = (n / 7) * 2;
                max = ((n / 7) * 2) ;
            }
            if(n % 7 ==1){
                min = (n / 7) * 2;
                max = ((n / 7) * 2) + 1 ;
            }
        }
      System.out.println(min+" "+max);

    }

}

import java.util.Scanner;

public class Holidays {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        System.out.print(n/7*2+" ");
        if(n%7>1) System.out.print(n/7*2+2);
        else System.out.print(n/7*2);
    }
}

import java.util.*;
public final class Main {

	public static void main(String args[]) {
		Scanner in=new Scanner(System.in);
	  int a1 = in.nextInt();
	  if(a1%7==0){
	      System.out.print((2*a1/7)+" "+ (2*a1/7));
	  }
	  else if(a1%7<=5){
	      System.out.print((a1/7*2)+" "+(a1/7*2+2));
	  }
	  else {
	      System.out.print((a1/7*2+1)+" "+ (a1/7*2+2));
	  }
	}

	}

import java.util.*;
public class Holiday
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
if(n % 7 == 0)
{
    System.out.println(((n/7)*2) + " " + ((n / 7)*2));
}
else
{
    int a = (n/7)*2;
    int b = ((n/7)*2)+2;
    System.out.println(a + " " + b);
}
}
}

import java.io.*;

public class Holidays
{
	public static void main(String args[]) throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());

		int min = 0,max=0;
		if(n<7)
		{
			min = 0;
			if(n>2)
				max = 2;
			else
				max = n;
		}
		else
		{
			min = ((int)Math.floor(n/7));
			min *= 2;

			if(n%7<=2)
				max+=(n%7);
			else
				max+=2;

			max += min;
		}
		System.out.println(min+" "+max);
	}
}

/*
 *  This code is created by iBaskati (Momkin T3tini Chi 7al)
 *  AB&X is Love, AB&X is Life  *
 */

/**
 *
 * @author 0110
 */

import java.io.*;
import java.text.ParseException;
import java.util.*;

public class Codeforces  {

    public static void main(String[] args) throws IOException, ParseException{
        //Kattio sc = new Kattio(System.in,System.out);
        //Kattio sc = new Kattio(new FileInputStream("src/INPUT"),System.out);
        Scanner sc = new Scanner(System.in);
        //Scanner sc = new Scanner(new FileInputStream("src/INPUT"));
        long n = sc.nextLong();

        long p = n/7;
        long r = n%7;

        if(r==6){
            System.out.println((p*2+1)+" "+(p*2+3));
        }
        else{
            if(r>2) r=2;
            System.out.println(p*2+" "+(p*2+r));
        }

    }

    /// 1 2 3 4 5 6 7

    static class couple implements Comparable<couple>  {
        int res;
        int time;
        couple (int res, int time){
            this.time = time;
            this.res = res;
        }

        @Override
        public int compareTo(couple o) {
            return this.time - o.time;
        }
    }

    static class Kattio extends PrintWriter {
        public Kattio(InputStream i) {
            super(new BufferedOutputStream(System.out));
            r = new BufferedReader(new InputStreamReader(i));
        }
        public Kattio(InputStream i, OutputStream o) {
            super(new BufferedOutputStream(o));
            r = new BufferedReader(new InputStreamReader(i));
        }

        public Kattio(FileInputStream i) {
            super(new BufferedOutputStream(System.out));
            r = new BufferedReader(new InputStreamReader(i));
        }

        public Kattio(FileInputStream i, OutputStream o) {
            super(new BufferedOutputStream(o));
            r = new BufferedReader(new InputStreamReader(i));
        }

        public boolean hasMoreTokens() {
            return peekToken() != null;
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public String next() {
            return nextToken();
        }

        private BufferedReader r;
        private String line;
        private StringTokenizer st;
        private String token;

        private String peekToken() {
            if (token == null)
                try {
                    while (st == null || !st.hasMoreTokens()) {
                        line = r.readLine();
                        if (line == null) return null;
                        st = new StringTokenizer(line);
                    }
                    token = st.nextToken();
                } catch (IOException e) { }
            return token;
        }

        private String nextToken() {
            String ans = peekToken();
            token = null;
            return ans;
        }
    }

}

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
       Scanner in=new Scanner(System.in);
       while(in.hasNext()){
           int c=in.nextInt();
           int min=0;
           int max=0;
           if(c<7){
               if(c>2){
                  System.out.println(min+" "+(max+2));
               }else{
                  System.out.println(min+" "+c);
               }
           }else{
               int num1=c/7;
               int num2=c%7;
               if(num2>2){
                  System.out.println(((num1*2)+2)+" "+(num1*2));
               }else{
                    System.out.println(((num1*2)+num2)+" "+(num1*2));
               }

           }

       }
    }
}

import java.util.Scanner;
public class mars
{
public static void main(String []arg)
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int min=0,max=0,c;
c=n;
while(n>0)
{
n=n-2;
if(n>=0)
max+=2;
n=n-5;
}
while(c>0)
{
c=c-7;
if(c>=0)
min+=2;
}
System.out.println(min+" "+max);
}}

import java.util.Scanner;

public class JavaApplication2
{

    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        int max=0;
        if(n%7==0)
        {
            System.out.println(n/7*2+" "+(n/7*2));
            return;
        }
        for(int i=0;n>0;i++)
        {
            if(i%2==0)
            {
                max++;
                n-=2;
            }
            else
                n-=5;
        }
        System.out.println(max*2-2 + " "+(max*2));
    }

}

import java.util.Scanner;

public class x {
    public static void main(String args[]){
        Scanner console = new Scanner(System.in);
        int n=console.nextInt();
        int weeks=n/7;

        System.out.println((weeks*2 +n%7==6?1:0)+ " "+(weeks*2+Math.min(n%7,2)));
    }
}

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        int days = s.nextInt();
        if (days >= 1 && days <= 1000000) {

            if (days <= 7) {
                System.out.print(0 + " " + 2);
            } else if (days % 7 == 0) {
                System.out.print(days / 7 * 2 + " " + days / 7 * 2);
            } else System.out.print( (days / 7 * 2)  + " " + ((days / 7 * 2) + 2 ));

        }

    }
}

// https://codeforces.com/problemset/problem/670/A

import java.util.*;import java.io.*;import java.math.*;
public class Main
{

	public static void process()throws IOException
    {
    	int n=ni();
    	if(n<=7){
    		if(n==1){
    			pn("0 1");
    		}
    		else if(n>=6){
    			pn("1 2");
    		}
    		else{
    			pn("0 2");
    		}
    		return;
    	}

    	if(n==0){
    		pn("0 0");
    		return;
    	}
    	int min_df=(n/7)*2;
    	if(n%7==6)
    		min_df++;

    	int max_df=(n/7)*2;
    	if(n%7<=2)
    		max_df+=(n%7);
    	pn(min_df+" "+max_df);
    }

   	static AnotherReader sc;

    public static void main(String[]args)throws IOException
    {
    	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    	if(oj)
        	sc=new AnotherReader();
        else
        	sc=new AnotherReader(100);
        int t=1;
        while(t-->0)
            process();
        System.out.flush();
        System.out.close();
    }

    static void pn(Object o){System.out.println(o);}
    static void p(Object o){System.out.print(o);}
    static void pni(Object o){System.out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;

/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}

import java.util.*;
public class Holiday
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
if(n % 7 == 0)
{
    int ans = (n / 7)*2;
    System.out.print(ans + " " + ans);
}
else
{
    System.out.print(((n / 7)*2) + " " + (((n / 7)*2) + 2));
}
}
}

import java.util.*;
public class MyClass {
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        if(n<=5){
            int cnt=2;
            if(n==0)
                cnt=0;
            else if(n==1)
                cnt=1;
            System.out.println("0 "+cnt);
        }
        else if(n<=7)
            System.out.println("1 2");
        else{
            int cnt=n/7,rem=cnt%7;
            System.out.print(cnt*2);
            if(rem==0)
                cnt+=0;
            else if(rem==1)
                cnt+=1;
            else
                cnt+=2;
            System.out.print(" "+cnt);
        }
    }
}

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int days = n;
        int max =0;
        int min =0;
        if(days>=7){
            max = (days/7)*2;
            min = (days/7)*2;
            days = days%7;
        }
        if(days>2){
            max = max + 2;
        }
        if(days<2){
            max = max + days;
        }
        if(days>5){
            min = min + 7 - days;
        }

        System.out.println(min + " " + max);
    }
}

//package Codeforces.Div2A_350.Code1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/*
 * some cheeky quote
 */

public class Main
{
    FastScanner in;
    PrintWriter out;

    public void solve() throws IOException
    {
        int n = in.nextInt();
        int min = (n / 7) << 1;
        int max = min + Math.min(2, n % 7);
        System.out.println(min + " " + max);
    }

    public void run()
    {
        try
        {
            in = new FastScanner();
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e)
        {
            e.printStackTrace();
        }
    }

    class FastScanner
    {
        BufferedReader br;
        StringTokenizer st;

        FastScanner()
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreTokens())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }
    }

    public static void main(String[] arg)
    {
        new Main().run();
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author niko
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int min = 0, max = 0;
            if (n % 7 == 0) {
                min = (n / 7) * 2;
                out.print(min + " " + min);
            } else if (n % 7 == 1) {
                min = (n / 7) * 2;
                max = (n / 7) * 2 + 1;
                out.print(min + " " + min);
            } else {
                min = (n / 7) * 2;
                max = (n / 7) * 2 + 2;
                out.print(min + " " + max);
            }

        }

    }

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar;
        private int snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

import java.util.Scanner;

public class Test
{
    static int minNumber = 0;
    static int maxNumber = 0;

    public static void main(String[] args)
    {

        Scanner scanner = new Scanner(System.in);
        int numberofDays = scanner.nextInt();

        int x = numberofDays % 7;
        if (x == 0)
        {
            zero(numberofDays);

        }
        else
        {
            lessThanWeek(x);

            if (numberofDays > 7)
            {
                zero(numberofDays - x);
            }
        }
        System.out.println(minNumber + " " + maxNumber);
    }

    private static void zero(int x)
    {
        int offDays = (x / 7) * 2;
        minNumber += offDays;
        maxNumber += offDays;
    }

    private static void lessThanWeek(int x)
    {
        if (x <= 2)
        {
            // minNumber = 0;
            maxNumber += x;
        }
        else
        {
            // minNumber = 0;
            maxNumber += 2;
        }
    }

}

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int min = 0;
        int max = 1;
        if(n>1){
            max++;
        }
        if(n>5){
            min++;
            if(n>6){
                min++;
            }
        }
        if(n>7){
            int ad1 = 0;
            int ad2 = 0;
            if(n%7==1)
                ad2++;
            else if(n%7>1){
                ad2++;
                if(n%7==6)
                    ad1++;
            }
            min+=2*((n-7)/7)+ad1;
            max+=2*((n-7)/7)+ad2;
        }
        System.out.print(min+" "+max);
    }
}

// https://codeforces.com/problemset/problem/670/A

import java.util.*;import java.io.*;import java.math.*;
public class Main
{

	public static void process()throws IOException
    {
    	int n=ni();
    	int min_df=(n/7)*2;
    	if(n%7==6)
    		min_df++;

    	int max_df=(n/7)*2;
    	if(n%7<=2)
    		max_df+=(n%7);
    	pn(min_df+" "+max_df);
    }

   	static AnotherReader sc;

    public static void main(String[]args)throws IOException
    {
    	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    	if(oj)
        	sc=new AnotherReader();
        else
        	sc=new AnotherReader(100);
        int t=1;
        while(t-->0)
            process();
        System.out.flush();
        System.out.close();
    }

    static void pn(Object o){System.out.println(o);}
    static void p(Object o){System.out.print(o);}
    static void pni(Object o){System.out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;

/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int min = 2*(n/7);
        int max = 1;
        if(n>1){
            max++;
        }
        max+=2*((n-2)/7);
        System.out.print(min+" "+max);
    }
}

import java.util.Scanner;

public class New {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanS = new Scanner(System.in);

		int n;
		int result;
		n = scanS.nextInt();
		result = n / 7;
		if (n % 7 == 0)
			System.out.println(result * 2 + " " + result * 2);
		else if (n % 7 == 1)
			System.out.println(result * 2 + " " + (result * 2 + 1));
		else if (n % 7 == 2)
			System.out.println(result * 2 + " " + (result * 2 + 2));
		else if (n % 7 == 6)
			System.out.println(result * 2 + " " + (result * 2 + 1));
		else
			System.out.println(result * 2 + " " + (result * 2 + 1));
	}

}

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int min = 2*(n/7);
        int max = 1;
        if(n>1 && n<8){
            max++;
        }
        else{
            max+=2*((n-2)/7);
        }
        System.out.print(min+" "+max);
    }
}

import java.lang.*;
import java.util.*;
public class insomi {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int min=0,max=0;
        if(n<=2)
        {
            max=n;
        }
        else if(n<6)
        {
            max=2;
        }
        else if(n<7)
        {
            min=7-n;
            max=2;
        }
        else {
            int r=n%7;
            int q=n/7;
            min=q*2;
            if(r==1) {
                min=q*2+1;
                max = min + 1;
            }
            else if(r>1) {
                max=min+2;
            }
            else
                max=min;
        }
        System.out.println(min+" "+max);

    }
}

import java.util.*;

import java.util.regex.Pattern;
import java.util.regex.Matcher;

/**
 *
 * @author Eroui Abdelaziz (eabdel@acm.org)
 * CodeForces Cotest 350 Div . 2
 * Problem A
 */
public class Main
{
    public static long MOD = 100_000_000_7;
    public static long[][] C = new long[1010][1010];

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        //String line = in.nextLine();
        int T = in.nextInt();
        //int T = Integer.valueOf(in.nextLine());

        int min = T*2/7;
        int max = min;
        if(T%7 > 0) max += T%7*2/2;

        System.out.println(min+" "+max);

    }

    public static long gcd(long a, long b) {
        return b == 0 ? a: gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
         return a* (b* gcd(a, b));
    }

    public static int gcd(int a, int b) {
        return b == 0 ? a: gcd(b, a % b);
    }

    public static int lcm(int a, int b) {
         return a* (b* gcd(a, b));
    }

    public static void nCr(int n, int r) {

 	for (int i = 0; i <= n; i++){
            for (int j = 0; j <= Math.min(i, r); j++){
                if (j == 0 || j == i)
                    C[i][j] = 1;
                            else
                    C[i][j] = (C[i-1][j-1] + C[i-1][j])%MOD;
            }
        }

    }
}

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        int days = s.nextInt();
        if (days >= 1 && days <= 1000000) {

            if (days < 7) {
                System.out.print(0 + " " + 2);
            } else if (days % 7 == 0) {
                System.out.print(days / 7 * 2 + " " + days / 7 * 2);
            } else {
                    if (days - 7 * ((days/7) +1)== -1 ){
                        System.out.print(((days/7*2)-1) + " " + ((days/7*2)+2) );
                    }else
                        if (days % 7 == 1){
                            System.out.print((days/7*2) + " " + ((days/7*2) + 1) );
                        }else {
                            System.out.print((days/7*2) + " " + ((days/7*2) + 2));
                        }
            }

        }

    }
}

import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(),min=0,max=0;
		if (a<6){
			if(a==1){
				min=0;
				max=1;
			} else {
				min=0;
				max=2;
			}
		}
		if (a==6){
			min=1;
			max=2;
		}
		if(a>7){
			min=(a/7)*2;
			max=min;
		}
		System.out.print(min+" "+max);
	}
}

import java.util.Scanner;
import java.util.*;
import java.io.*;
import java.math.*;

//********************************************************K.S.J_@@@@@@@@@@@@@@@@@@@@@@@@@****************************

public class MArs{
	static BufferedReader reader;
    static StringTokenizer tokenizer;

	static void init(InputStream input) {reader = new BufferedReader(new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
	static String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { tokenizer = new StringTokenizer(reader.readLine() );}
        return tokenizer.nextToken();
    }
	static String nextLine() throws IOException { return  next();}
	static int nextInt() throws IOException {return Integer.parseInt( next() );}
	static double nextDouble() throws IOException {return Double.parseDouble( next() );}
	static long nextLong() throws IOException {return Long.parseLong( next() );}
	static BigInteger nextBigInteger() throws IOException {return new BigInteger(next()) ;}

	public static void main(String args[]) throws IOException{
		init(System.in);
			int T=nextInt();

			if(T%7==0){
			System.out.println((2*(T/7))+" "+(2*(T/7)));
			}
			else{
				int min=(2*(T/7));
				if(T%7>=2)
				System.out.println(min+" "+(min+2));
				else
				System.out.println(min+" "+(min+1));

			}

			}

}

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int day = sc.nextInt();

		int max = (day>7) ? 2*day/7 : 0;
		int min = max;

		if (day%7 >= 2)
			max+=2;
		if (0<day%7 && day%7<2)
			max+=day%7;
		if (day%7==6)
		    min+=1;

		System.out.println(min);
		System.out.println(max);
	}

}

// https://codeforces.com/problemset/problem/670/A

import java.util.*;import java.io.*;import java.math.*;
public class Main
{

	public static void process()throws IOException
    {
    	int n=ni();
    	if(n==0){
    		pn("0 0");
    		return;
    	}
    	if(n<=7){
    		if(n==1){
    			pn("0 1");
    		}
    		else if(n==6){
    			pn("1 2");
    		}
    		else if(n==7)
    			pn("2 2");
    		else{
    			pn("0 2");
    		}
    		return;
    	}

    	int min_df=(n/7)*2;
    	if(n%7==6)
    		min_df++;

    	int max_df=(n/7)*2;
    	if(n%7==2)
    		max_df+=2;
    	else if(n%7==1)
    		max_df+=1;
    	pn(min_df+" "+max_df);
    }

   	static AnotherReader sc;

    public static void main(String[]args)throws IOException
    {
    	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    	if(oj)
        	sc=new AnotherReader();
        else
        	sc=new AnotherReader(100);
        int t=1;
        while(t-->0)
            process();
        System.out.flush();
        System.out.close();
    }

    static void pn(Object o){System.out.println(o);}
    static void p(Object o){System.out.print(o);}
    static void pni(Object o){System.out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;

/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}

import java.util.Scanner;

public class Palindrome
{
	public static void main(String[] args) {

		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int minholiday=n/7;
		int mod=n%7;
		if(mod>5)
			System.out.println(minholiday*2+mod-5);
		else
			System.out.println(minholiday*2);
		int maxholiday=(n-2)/7;
		mod=(n-2)%7;
		if(mod>=5)
			System.out.println(maxholiday*2+mod-5+2);
		else
			System.out.println(maxholiday+2);
	}
}

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
       int days=scan.nextInt();
        int min=(days/7)*2;
        if(days==6){
            min=1;
        }
        int max;
        if(days>=2) {
           max = 2 + ((days - 2) / 7) * 2;
            if((days-2)%7==6){
                max++;
            }
        }
        else{
            max=days;
        }
        System.out.println(min+" "+max);

    }
}

import java.util.Scanner;

public class Sol {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int max = 0;
        int min = 0;
        int n = sc.nextInt();
        if (n == 1){
            System.out.print(0 + " ");
            System.out.println(1);
            return;
        }
        if(n < 6){
            System.out.print(0 + " ");
            System.out.println(2);
            return;
        }
        for(int i = 1; i <= n; i++) {
            if((i+1) % 7 == 0 && i == n) {
                min -= 1;
            }
            if ((i-2) % 7 == 0) {
                max += 2;
                min += 2;
                i += 3;
            } else if ((i-1) % 7 == 0 && i == n) {
                max += 1;
            }
        }
        System.out.print(min + " ");
        System.out.println(max);
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Main mainClass = new Main();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	public String next() throws Exception {
		if (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}

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

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

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

	public Main() throws Exception {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));

		solve();
		out.close();
	}

	int f(int n) {
		return n <= 2 ? n : 2 + (n-2)/7*2;
	}

	public void solve() throws Exception {

		int n = nextInt();
		int mx = f(n);
		int mn = f(Math.max(n-5, 0));
		out.println(mn + " " + mx);

	}
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package cf7;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.*;

/**
 *
 * @author varun
 */
public class CF7 {

    /**
     * @param args the command line arguments
     */

    public static int log(int N){
        int result = (int)(Math.log(N) / Math.log(2));
        return result;
    }

    public static int log_s(int N){
        int result = (int)(Math.log(N) / Math.log(7));
        return result;
    }

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        Reader.init(System.in);
        int n = Reader.nextInt();
        int max = log(n);
        int min_off=0;
        int max_off=0;
        if(n%7==0){
            max = log_s(n);
            min_off = 2*max;
            max_off = 2*max;
            System.out.println(min_off + " " + max_off);
        }
        else{
            min_off = 2*(max-1);
            max_off = 2*max;
        }
        System.out.println(min_off + " " + max_off);
    }

}

class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

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

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }
}

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

public class Holidays {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        PrintWriter printWriter = new PrintWriter(System.out);
        int res = 0;
        int min = t / 7 * 2;
        if (t % 7 == 0) {
            res = t / 7 * 2;
        } else {
            int dif = t % 7;
            res = t / 7 * 2;
            if (dif == 1) {
                res += 1;
            } else if (dif == 2){
                res += 2;
            }
        }
        printWriter.println(min + " " + res);
        printWriter.flush();
    }
}

import java.util.Scanner;

public class New {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanS = new Scanner(System.in);

		int n;
		int result;
		n = scanS.nextInt();
		result = n / 7;
		if (n % 7 == 0)
			System.out.println(result * 2 + " " + result * 2);
		else {
			if (n % 7 == 1)
				System.out.println(result * 2 + " " + result * 2 + 1);
			else
				System.out.println(result * 2 + " " + (result * 2 + 1));
		}

	}
}

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

public class Holidays {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        PrintWriter printWriter = new PrintWriter(System.out);
        int res = 0;
        int min = t / 7 * 2;
        if (t % 7 == 0) {
            res = t / 7 * 2;
        } else {
            int dif = t % 7;
            res = t / 7 * 2;
            if (dif == 1) {
                res += 1;
            } else {
                res += 2;
            }
        }
        printWriter.println(min + " " + res);
        printWriter.flush();
    }
}

import java.util.Scanner;

public class New {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanS = new Scanner(System.in);

		int n;
		int result;
		n = scanS.nextInt();
		result = n / 7;
		if (n % 7 == 0)
			System.out.println(result * 2 + " " + result * 2);
		else if (n % 7 == 1)
			System.out.println(result * 2 + " " + (result * 2 + 1));
		else if (n % 7 == 2)
			System.out.println(result * 2 + " " + (result * 2 + 2));
		else if (n % 7 == 6)
			System.out.println(result * 2 + " " + (result * 2 + 1));
		else if (n % 7 == 3)
			System.out.println(result * 2 + " " + (result * 2 + 2));
		else
			System.out.println(result * 2 + " " + (result * 2 + 1));
	}

}

import java.util.*;

public class problem670A
{
	private static Scanner in = new Scanner(System.in);
	private static int n = 0, min = 0, max = 0;
	public static void main(String[] args)
	{
		n = in.nextInt();
		if (n == 1) { min = 0; max = 1; }
		else if (n % 7 == 0) min = max = (n / 7) * 2;
		else
		{
			min = ((n - (n % 7)) / 7) * 2;
			max = min + 2;
		}
		System.out.println(min + " " + max);
	}
}

import java.util.Scanner;

public class Test
{
    static int minNumber = 0;
    static int maxNumber = 0;

    public static void main(String[] args)
    {

        Scanner scanner = new Scanner(System.in);
        int numberofDays = scanner.nextInt();

        int x = numberofDays % 7;
        if (x == 0)
        {
            zero(numberofDays);

        }
        else
        {
            lessThanWeek(x);

            if (numberofDays > 7)
            {
                zero(numberofDays - x);
            }
        }
        System.out.println(minNumber + " " + maxNumber);
    }

    private static void zero(int x)
    {
        int offDays = (x / 7) * 2;
        minNumber += offDays;
        maxNumber += offDays;
    }

    private static void lessThanWeek(int x)
    {
        if (x <= 2)
        {
            // minNumber = 0;
            maxNumber += x;
        }
        else
        {
            // minNumber = 0;
            maxNumber += 2;
        }
    }

}

import java.io.*;
import java.util.StringTokenizer;

public class main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer s=new StringTokenizer(br.readLine());
		int n=Integer.parseInt(s.nextToken());

		if(n%7==0){
			System.out.println((n/7)*2 +" " +(n/7)*2);
		}
		if(n%7==1){
			System.out.println((n/7)*2 +" " +((n/7)*2+1));
		}
		else{
			System.out.println((n/7)*2 +" " +((n/7)*2+2));
		}

	}

}

import java.util.Scanner;
public class HelloWorld{

     public static void main(String []args)
     {
        int y, mind, maxd, m;
        Scanner in= new Scanner(System.in);
        y = in.nextInt();
        if (y == 1)
        {
            mind = 0;
            maxd = 1;
        }
        else if (y <= 5 && y >= 2)
        {
            mind = 0;
            maxd = 2;
        }
        else if (y == 6)
        {
            mind = 1;
            maxd = 2;
        }
        else
        {
            m = y/7;
            mind = m*2;
            maxd = m*2;
        }
        System.out.print(mind+" "+maxd);
     }
}

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
       int days=scan.nextInt();
        int min=(days/7)*2;
        int max=2+((days-2)/7)*2;
        System.out.println(min+" "+max);

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Objects;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		InputStream in = System.in;
		OutputStream out = System.out;
		InputReader reader = new InputReader(in);
		PrintWriter writer = new PrintWriter(out);
		new TaskA(writer).solve(reader);
		writer.close();
	}

	static class TaskA {

		private static final int N = 100010 * 6;
		private PrintWriter out;

		public TaskA(PrintWriter out) {
			this.out = out;
		}

		int calc(int days) {
			if (days == 1)
				return 1;
			if (days == 0)
				return 0;
			return 2;
		}

		void solve(InputReader in) {
			int n = in.nextInt();
			if (n == 1)
				printf("0 1\n");
			else if (n == 6)
				printf("1 2\n");
			else if (n > 1 && n < 6)
				printf("0 2\n");
			else
				printf("%d %d\n", n / 7 * 2, n / 7 * 2 + calc(n % 7));
		}

		void printf(String format, Object... args) {
			out.printf(format, args);
		}

	}

	static class InputReader {
		private StringTokenizer token;
		private BufferedReader reader;

		public InputReader(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}

		public String next() {
			while (Objects.isNull(token) || !token.hasMoreTokens()) {
				try {
					token = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new IllegalStateException();
				}
			}
			return token.nextToken();
		}

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

	}

}

import java.util.Scanner;
public class HelloWorld
{
    public static void main(String []args)
    {
        int y, mind, maxd, m, mod;
        Scanner in= new Scanner(System.in);
        y = in.nextInt();
        if (y == 1)
        {
            mind = 0;
            maxd = 1;
        }
        else if (y <= 5 && y >= 2)
        {
            mind = 0;
            maxd = 2;
        }
        else if (y == 6)
        {
            mind = 1;
            maxd = 2;
        }
        else if (y == 7)
        {
            mind = 2;
            maxd = 2;
        }
        else
        {
            mod = y%7;
		    m = y/7;
		    maxd = m*2;
            mind = m*2;
            if(mod == 1)
            {
                maxd = m*2+1;
            }
            else if(mod == 2)
            {
                maxd = m*2+2;
            }
            else if(mod == 3)
            {
                maxd = m*2+2;
                mind = m*2+1;
            }
            else
            {
            maxd = m*2;
            mind = m*2;
            }
        }
        System.out.print(mind + " " + maxd);
    }
}

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Another {

    long gcd(long a, long b) {
        if (a == 0) {
            return b;
        }
        return gcd(b % a, a);
    }

// Function to find gcd of array of
// numbers
    long findGCD(long arr[], long n) {
        long result = arr[0];
        for (int i = 1; i < n; i++) {
            result = gcd(arr[i], result);
        }

        return result;
    }

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        boolean flag=false;
        Set<Long> lst = new HashSet<Long>();
        int t=in.nextInt();
        if(t%7==0)
        {
            int temp=t/7;
            temp*=2;
            System.out.println(temp+" "+temp);
        }
        else
        {
            int temp=t/7;
           int max=temp*2+(t-(temp*7));
           int min=temp*2;
           System.out.println(min+" "+max);
        }

    }

}

import java.util.*;
public class Holidays {
public static void main(String [] args)
{
	Scanner sc=new Scanner(System.in);
	int n=sc.nextInt();
	int min=0;
	int max=0;
	int a=n/7;
	if(n%7==0)
	{
		min=2*(a);
		max=2*(a);
		System.out.println(min+" "+max);
	}
	else
	{
		int r=n%7;

		if(r<=2)
		{
			min=2*(a);
			max=2*(a)+r;
			System.out.println(min+" "+max);
		}
		else if(r>2 )
		{

			min=2*(a);
			max=2*(a)+2;
			System.out.println(min+" "+max);
		}

	}
}
}

import java.util.*;
public class Holidays{
    public static void main(String args []){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n < 7){
            int mi = 0 ;
            if (n>5){
                mi = 1 ;
                System.out.println(mi + " " + 2);
            }else{
                mi = 0;
                if (n>1){
                    System.out.println(mi + " " + 2);
                }else {
                    System.out.println(mi + " " + 1);
                }

            }
        }else {
            int w = n/7;
            int mi = w*2;
            int r = n - w*7 ;
            if (r>5){
                int ma = mi + 2;
                System.out.println(mi+1 + " " + ma);
            }else {
                int ma = mi + r ;
                System.out.println(mi + " " + ma);
            }
        }
    }
}

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.InputMismatchException;
import java.util.StringTokenizer;

public class CodeA {
  private static final boolean SHOULD_BUFFER_OUTPUT = false;

  static final SuperWriter sw = new SuperWriter(System.out);

  static final SuperScanner sc = new SuperScanner();

  public static void main() {
    int n = sc.nextInt();
    int min = Integer.MAX_VALUE;
    int max = 0;
    for (int i = 0; i < 7; i++) {
      int current = 0;
      int nP = n;
      if (i <= 5 && i + (n - 1) >= 5) {
        current++;
      }
      if (i <= 6 && i + (n - 1) >= 6) {
        current++;
      }
      nP -= Math.min(n, 7);
      current += ((nP / 7) * 2);
      nP -= (nP / 7) * 7;
      if (nP >= 6) {
        current++;
      }
      max = Math.max(max, current);
      min = Math.min(min, current);
    }
    sw.printLine(min, max);
  }

  static class LineScanner extends Scanner {
    private StringTokenizer st;

    public LineScanner(String input) {
      st = new StringTokenizer(input);
    }

    @Override
    public String next() {
      return st.hasMoreTokens() ? st.nextToken() : null;
    }

    @Override
    public String nextLine() {
      throw new RuntimeException("not supported");
    }

    public boolean hasNext() {
      return st.hasMoreTokens();
    }

    private final ArrayList<Object> temp = new ArrayList<Object>();

    private void fillTemp() {
      while (st.hasMoreTokens()) {
        temp.add(st.nextToken());
      }
    }

    public String[] asStringArray() {
      fillTemp();
      String[] answer = new String[temp.size()];
      for (int i = 0; i < answer.length; i++) {
        answer[i] = (String) temp.get(i);
      }
      temp.clear();
      return answer;
    }

    public int[] asIntArray() {
      fillTemp();
      int[] answer = new int[temp.size()];
      for (int i = 0; i < answer.length; i++) {
        answer[i] = Integer.parseInt((String) temp.get(i));
      }
      temp.clear();
      return answer;
    }

    public long[] asLongArray() {
      fillTemp();
      long[] answer = new long[temp.size()];
      for (int i = 0; i < answer.length; i++) {
        answer[i] = Long.parseLong((String) temp.get(i));
      }
      temp.clear();
      return answer;
    }

    public double[] asDoubleArray() {
      fillTemp();
      double[] answer = new double[temp.size()];
      for (int i = 0; i < answer.length; i++) {
        answer[i] = Double.parseDouble((String) temp.get(i));
      }
      temp.clear();
      return answer;
    }
  }

  static class SuperScanner extends Scanner {
    private InputStream stream;
    private byte[] buf = new byte[8096];
    private int curChar;
    private int numChars;

    public SuperScanner() {
        this.stream = System.in;
    }

    public int read() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public static boolean isWhitespace(int c) {
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public static boolean isLineEnd(int c) {
      return c == '\n' || c == -1;
    }

    private final StringBuilder sb = new StringBuilder();

    @Override
    public String next() {
      int c = read();
      while (isWhitespace(c)) {
          if (c == -1) {
            return null;
          }
          c = read();
      }
      sb.setLength(0);
      do {
          sb.append((char) c);
          c = read();
      } while (!isWhitespace(c));
      return sb.toString();
    }

    @Override
    public String nextLine() {
      sb.setLength(0);
      int c;
      while (true) {
        c = read();
        if (!isLineEnd(c)) {
          sb.append((char) c);
        } else {
          break;
        }
      }
      if (c == -1 && sb.length() == 0) {
        return null;
      } else {
        if (sb.length() > 0 && sb.charAt(sb.length() - 1) == '\r') {
          return sb.substring(0, sb.length() - 1);
        } else {
          return sb.toString();
        }
      }
    }

    public LineScanner nextLineScanner() {
      String line = nextLine();
      if (line == null) {
        return null;
      } else {
        return new LineScanner(line);
      }
    }

    public LineScanner nextNonEmptyLineScanner() {
      while (true) {
        String line = nextLine();
        if (line == null) {
          return null;
        } else if (!line.isEmpty()) {
          return new LineScanner(line);
        }
      }
    }

    @Override
    public int nextInt() {
        int c = read();
        while (isWhitespace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res = (res << 3) + (res << 1);
            res += c - '0';
            c = read();
        } while (!isWhitespace(c));
        return res * sgn;
    }

    @Override
    public long nextLong() {
        int c = read();
        while (isWhitespace(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res = (res << 3) + (res << 1);
            res += c - '0';
            c = read();
        } while (!isWhitespace(c));
        return res * sgn;
    }
  }

  static abstract class Scanner {

    public abstract String next();

    public abstract String nextLine();

    public int nextIntOrQuit() {
      Integer n = nextInteger();
      if (n == null) {
        sw.close();
        System.exit(0);
      }
      return n.intValue();
    }

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

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

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

    public int[] nextIntArray(int n) {
      int[] res = new int[n];
      for (int i = 0; i < res.length; i++)
        res[i] = nextInt();
      return res;
    }

    public long[] nextLongArray(int n) {
      long[] res = new long[n];
      for (int i = 0; i < res.length; i++)
        res[i] = nextLong();
      return res;
    }

    public double[] nextDoubleArray(int n) {
      double[] res = new double[n];
      for (int i = 0; i < res.length; i++)
        res[i] = nextDouble();
      return res;
    }

    public void sortIntArray(int[] array) {
      Integer[] vals = new Integer[array.length];
      for (int i = 0; i < array.length; i++)
        vals[i] = array[i];
      Arrays.sort(vals);
      for (int i = 0; i < array.length; i++)
        array[i] = vals[i];
    }

    public void sortLongArray(long[] array) {
      Long[] vals = new Long[array.length];
      for (int i = 0; i < array.length; i++)
        vals[i] = array[i];
      Arrays.sort(vals);
      for (int i = 0; i < array.length; i++)
        array[i] = vals[i];
    }

    public void sortDoubleArray(double[] array) {
      Double[] vals = new Double[array.length];
      for (int i = 0; i < array.length; i++)
        vals[i] = array[i];
      Arrays.sort(vals);
      for (int i = 0; i < array.length; i++)
        array[i] = vals[i];
    }

    public String[] nextStringArray(int n) {
      String[] vals = new String[n];
      for (int i = 0; i < n; i++)
        vals[i] = next();
      return vals;
    }

    public Integer nextInteger() {
      String s = next();
      if (s == null)
        return null;
      return Integer.parseInt(s);
    }

    public int[][] nextIntMatrix(int n, int m) {
      int[][] ans = new int[n][];
      for (int i = 0; i < n; i++)
        ans[i] = nextIntArray(m);
      return ans;
    }

    public char[][] nextGrid(int r) {
      char[][] grid = new char[r][];
      for (int i = 0; i < r; i++)
        grid[i] = next().toCharArray();
      return grid;
    }

    public static <T> T fill(T arreglo, int val) {
      if (arreglo instanceof Object[]) {
        Object[] a = (Object[]) arreglo;
        for (Object x : a)
          fill(x, val);
      } else if (arreglo instanceof int[])
        Arrays.fill((int[]) arreglo, val);
      else if (arreglo instanceof double[])
        Arrays.fill((double[]) arreglo, val);
      else if (arreglo instanceof long[])
        Arrays.fill((long[]) arreglo, val);
      return arreglo;
    }

    public <T> T[] nextObjectArray(Class<T> clazz, int size) {
      @SuppressWarnings("unchecked")
      T[] result = (T[]) java.lang.reflect.Array.newInstance(clazz, size);
      for (int c = 0; c < 3; c++) {
        Constructor<T> constructor;
        try {
          if (c == 0)
            constructor = clazz.getDeclaredConstructor(Scanner.class,
                Integer.TYPE);
          else if (c == 1)
            constructor = clazz.getDeclaredConstructor(Scanner.class);
          else
            constructor = clazz.getDeclaredConstructor();
        } catch (Exception e) {
          continue;
        }
        try {
          for (int i = 0; i < result.length; i++) {
            if (c == 0)
              result[i] = constructor.newInstance(this, i);
            else if (c == 1)
              result[i] = constructor.newInstance(this);
            else
              result[i] = constructor.newInstance();
          }
        } catch (Exception e) {
          throw new RuntimeException(e);
        }
        return result;
      }
      throw new RuntimeException("Constructor not found");
    }

    public Collection<Integer> wrap(int[] as) {
      ArrayList<Integer> ans = new ArrayList<Integer>();
      for (int i : as)
        ans.add(i);
      return ans;
    }

    public int[] unwrap(Collection<Integer> collection) {
      int[] vals = new int[collection.size()];
      int index = 0;
      for (int i : collection)
        vals[index++] = i;
      return vals;
    }

    int testCases = Integer.MIN_VALUE;

    boolean testCases() {
      if (testCases == Integer.MIN_VALUE) {
        testCases = nextInt();
      }
      return --testCases >= 0;
    }
  }

  static class SuperWriter {

    private final PrintWriter writer;

    public SuperWriter(OutputStream outputStream) {
      writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public SuperWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void close() {
        writer.flush();
        writer.close();
    }

    public void printLine(String line) {
      writer.println(line);
      if (!SHOULD_BUFFER_OUTPUT) {
        writer.flush();
      }
    }

    public void printLine(int... vals) {
      if (vals.length == 0) {
        writer.println();
      } else {
        writer.print(vals[0]);
        for (int i = 1; i < vals.length; i++)
          writer.print(" ".concat(String.valueOf(vals[i])));
        writer.println();
      }
      if (!SHOULD_BUFFER_OUTPUT) {
        writer.flush();
      }
    }

    public void printLine(long... vals) {
      if (vals.length == 0) {
        writer.println();
      } else {
        writer.print(vals[0]);
        for (int i = 1; i < vals.length; i++)
          writer.print(" ".concat(String.valueOf(vals[i])));
        writer.println();
      }
      if (!SHOULD_BUFFER_OUTPUT) {
        writer.flush();
      }
    }

    public void printLine(double... vals) {
      if (vals.length == 0) {
        writer.println();
      } else {
        writer.print(vals[0]);
        for (int i = 1; i < vals.length; i++)
          writer.print(" ".concat(String.valueOf(vals[i])));
        writer.println();
      }
      if (!SHOULD_BUFFER_OUTPUT) {
        writer.flush();
      }
    }

    public void printLine(int prec, double... vals) {
      if (vals.length == 0) {
        writer.println();
      } else {
        String precision = "%." + prec + "f";
        writer.print(String.format(precision, vals[0]).replace(',', '.'));
        precision = " " + precision;
        for (int i = 1; i < vals.length; i++)
          writer.print(String.format(precision, vals[i]).replace(',', '.'));
        writer.println();
      }
      if (!SHOULD_BUFFER_OUTPUT) {
        writer.flush();
      }
    }

    public <E> void printLine(Collection<E> vals) {
      if (vals.size() == 0) {
        writer.println();
      } else {
        int i = 0;
        for (E val : vals) {
          if (i++ == 0) {
            writer.print(val.toString());
          } else {
            writer.print(" ".concat(val.toString()));
          }
        }
        writer.println();
      }
      if (!SHOULD_BUFFER_OUTPUT) {
        writer.flush();
      }
    }

    public void printSimple(String value) {
      writer.print(value);
      if (!SHOULD_BUFFER_OUTPUT) {
        writer.flush();
      }
    }

    public boolean ifZeroExit(Number... values) {
    	for (Number number : values) {
    		if (number.doubleValue() != 0.0d || number.longValue() != 0) {
    			return false;
    		}
    	}
    	close();
    	System.exit(0);
    	return true;
    }
  }

  public static void main(String[] args) {
    main();
    sw.close();
  }
}

import java.util.Scanner;

public class asd {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		String s ="";
		int days=0;
		days=2*x/7;
		if(x%7==0)
		s=days+" "+days;
		else
		{
			int c = days+(x-((days/2)*7));
			s=days+" "+c;
		}
			System.out.println(s);
	}

}

import java.util.*;

public class walaa{
	public static void main(String[]args){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int max, min;
		if(n == 1){
			max = 1;
			min = 0;
		}else if(n >= 7){
			max = 2 + n/7;
			min = max;
		}else
			if(n >= 5){
				min = n-5;
				max = 2;
			}else{
				max = 2;
				min = 0;
			}
		System.out.println(min + " " + max);
	}
}

import java.util.Scanner;
import java.util.*;
import java.io.*;
import java.math.*;

//********************************************************K.S.J_@@@@@@@@@@@@@@@@@@@@@@@@@****************************

public class MArs{
	static BufferedReader reader;
    static StringTokenizer tokenizer;

	static void init(InputStream input) {reader = new BufferedReader(new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
	static String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { tokenizer = new StringTokenizer(reader.readLine() );}
        return tokenizer.nextToken();
    }
	static String nextLine() throws IOException { return  next();}
	static int nextInt() throws IOException {return Integer.parseInt( next() );}
	static double nextDouble() throws IOException {return Double.parseDouble( next() );}
	static long nextLong() throws IOException {return Long.parseLong( next() );}
	static BigInteger nextBigInteger() throws IOException {return new BigInteger(next()) ;}

	public static void main(String args[]) throws IOException{
		init(System.in);
			int T=nextInt();
			if(T==6){System.out.println("0 2");}
			else if(T%7==0){
			System.out.println((2*(T/7))+" "+(2*(T/7)));
			}
			else{
				int min=(2*(T/7));
				if(T%7>=2)
				System.out.println(min+" "+(min+2));
				else
				System.out.println(min+" "+(min+1));

			}

			}

}

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

public class Holidays {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        PrintWriter printWriter = new PrintWriter(System.out);
        int res = 0;
        int min = t / 7 * 2;
        if (t % 7 == 0) {
            res = t / 7 * 2;
        } else {
            int dif = t % 7;
            res = t / 7 * 2;
            if (dif == 1) {
                res += 1;
            } else if (dif == 2){
                res += 2;
            }
        }
        printWriter.println(min + " " + res);
        printWriter.flush();
    }
}

import java.util.Scanner;
public class main {
    public static void main(String args[]) throws Exception {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if (n<=2) System.out.println("0 "+n);
        if(n<=7&&n>2){
            System.out.println("0 2");
        }
        if(n>7){
            int g = n/7;
            int r = g*2;
            int f = g*2 + (n-g*7);
            System.out.println(r+" "+f);
        }

    }
}