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

import static java.lang.Math.min;

public class poker_nk_wa {
 
    public void solve() {

        long x = in.nextInt();
        long b = in.nextInt();
        char c = in.nextToken().charAt(0);
        //    if (c == 'L') {
                out.println(2* (x / (3 * b)) + (x - ((3 * b) * (x / (3 * b))) > b ? 2 : x - ((3 * b) * (x / (3 * b))) > 0 ? 1 : 0));
        //    } else {
        //        out.println(2* (x / (3 * b)) + (x - ((3 * b) * (x / (3 * b))) > 2 * b ? 2 : x - ((3 * b) * (x / (3 * b))) > 0 ? 1 : 0));
       //     }
        }
    

    MyScanner in;
    PrintWriter out;

    public void run() {
        try {
            in = new MyScanner("poker.in");
            out = new PrintWriter("poker.out");
            solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    class MyScanner {
        BufferedReader br;
        StringTokenizer st;

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

        public MyScanner(String name) {
            try {
                br = new BufferedReader(new FileReader(name));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

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

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

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

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

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