Problem: Throughout Igor K.'s life he has had many situations worthy of attention. We remember the story with the virus, the story of his mathematical career and of course, his famous programming achievements. However, one does not always adopt new hobbies, one can quit something as well.

This time Igor K. got disappointed in one of his hobbies: editing and voicing videos. Moreover, he got disappointed in it so much, that he decided to destroy his secret archive for good. 

Igor K. use Pindows XR operation system which represents files and folders by small icons. At that, m icons can fit in a horizontal row in any window.

Igor K.'s computer contains n folders in the D: disk's root catalog. The folders are numbered from 1 to n in the order from the left to the right and from top to bottom (see the images). At that the folders with secret videos have numbers from a to b inclusive. Igor K. wants to delete them forever, at that making as few frame selections as possible, and then pressing Shift+Delete exactly once. What is the minimum number of times Igor K. will have to select the folder in order to select folders from a to b and only them? Let us note that if some selected folder is selected repeatedly, then it is deselected. Each selection possesses the shape of some rectangle with sides parallel to the screen's borders.

Input

The only line contains four integers n, m, a, b (1 ≤ n, m ≤ 109, 1 ≤ a ≤ b ≤ n). They are the number of folders in Igor K.'s computer, the width of a window and the numbers of the first and the last folders that need to be deleted.

Output

Print a single number: the least possible number of times Igor K. will have to select the folders using frames to select only the folders with numbers from a to b.

Examples

Input

11 4 3 9


Output

3


Input

20 5 2 20


Output

2

Note

The images below illustrate statement tests.

The first test:

<image>

In this test we can select folders 3 and 4 with out first selection, folders 5, 6, 7, 8 with our second selection and folder 9 with our third, last selection.

The second test:

<image>

In this test we can first select all folders in the first row (2, 3, 4, 5), then — all other ones.

Solution (in JAVA):

Solution:
import java.util.InputMismatchException;
import java.math.BigInteger;
import java.util.Collection;
import java.util.ArrayList;
import java.util.List;
import java.io.*;
import java.util.Comparator;
import java.util.Iterator;
import java.util.Arrays;

/**
 * Generated by Contest helper plug-in
 * Actual solution is at the bottom
 */
public class lucksum {
        public static void main(String[] args) {
                InputReader in = new StreamInputReader(System.in);
                PrintWriter out = new PrintWriter(System.out);
                run(in, out);
        }

        public static void run(InputReader in, PrintWriter out) {
                Solver solver = new TaskE();
                solver.solve(1, in, out);
                Exit.exit(in, out);
        }
}

abstract class InputReader {
        private boolean finished = false;

        public abstract int read();

        public int readInt() {
                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 String readString() {
                int c = read();
                while (isSpaceChar(c))
                        c = read();
                StringBuffer res = new StringBuffer();
                do {
                        res.appendCodePoint(c);
                        c = read();
                } while (!isSpaceChar(c));
                return res.toString();
        }

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

        public void setFinished(boolean finished) {
                this.finished = finished;
        }

        public abstract void close();
}

class StreamInputReader extends InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar, numChars;

        public StreamInputReader(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 void close() {
                try {
                        stream.close();
                } catch (IOException ignored) {
                }
        }
}

class Exit {
        private Exit() {
        }

        public static void exit(InputReader in, PrintWriter out) {
                in.setFinished(true);
                in.close();
                out.close();
        }
}

interface Solver {
        public void solve(int testNumber, InputReader in, PrintWriter out);
}


class TaskE implements Solver {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
                int n = in.readInt();
                int m=in.readInt();
                int a=in.readInt();
                int b=in.readInt();
                int res=0;
                int tot=b-a+1;
                if((a-1)%m!=0)
                {
                        res++;
                        tot-=m-(a-1)%m;
                }
                int h=0;
                if(tot/m>0)
                        h++;
                if((b!=n)&&(b%m!=0))
                        if((b-1)/m!=(a-1)/m)
                                h++;
                if((tot>0)&&(h==0))
                	h=1;
                res+=h;
                if(res==0)
                        res=1;
                if(res==3)
                {
                        if((b-a+1)%m==0)
                                res=2;
                }
                out.println(res);
        }
}