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.
The only line contains four integers *n*, *m*, *a*, *b* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">9</sup>, 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.
The images below illustrate statement tests.

The first test:

<img class="tex-graphics" src="https://espresso.codeforces.com/a0e4ba690dd16e3c68210a28afd82020b23fb605.png" style="max-width: 100.0%;max-height: 100.0%;"/>

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:

<img class="tex-graphics" src="https://espresso.codeforces.com/289e2666a3d8b3dfe5b22ff3d88976df711640f7.png" style="max-width: 100.0%;max-height: 100.0%;"/>

In this test we can first select all folders in the first row (2, 3, 4, 5), then — all other ones.
11 4 3 9
3
20 5 2 20
2
1 1 1 1
1
26 5 2 18
3
21 5 1 15
1
21 5 1 21
1
21 5 8 14
2
20 4 1 20
1
21 5 1 13
2
21 5 4 15
2
17 3 1 16
2
19 5 7 19
2
18 2 1 13
2
21 3 6 11
2
21 5 3 12
2
21 3 6 10
3
28 5 4 26
3
21 5 6 18
2
21 5 4 21
2
17 5 6 17
1
21 5 9 12
2
21 3 6 7
2
21 5 7 9
1
12 4 5 8
1
21 3 6 8
2
21 1 5 17
1
5 5 2 4
1
18 4 6 17
2
18 4 6 18
2
16 4 1 16
1
20 4 7 14
2
17 3 12 16
3
12 4 8 9
2
11 8 2 7
1
27 5 4 24
3
29 5 12 27
3
30 5 5 29
2
91 2 15 72
1
41 1 8 27
1
26 5 7 21
2
70 5 31 33
1
84 9 6 80
3
79 8 41 64
1
63 11 23 48
2
97 9 18 54
2
75 18 20 23
1
66 42 43 44
1
92 54 20 53
1
32 90 31 32
1
18 100 6 6
1
458 12 203 310
2
149 49 92 129
2
264 2 9 63
2
908 6 407 531
3
410 36 109 191
2
301 38 97 171
3
691 27 313 499
3
939 42 86 827
3
280 32 64 277
3
244 25 94 199
3
134 110 11 52
1
886 251 61 672
3
261 686 243 254
1
162 309 68 98
1
476 398 77 256
1
258 224 84 174
1
357 182 73 247
2
488 655 290 457
1
149 334 78 105
1
488 519 203 211
1
192293793 2864 5278163 190776899
3
38644205 2729 9325777 31658388
3
268836959 6117 166683294 249843000
3
831447817 8377 549549158 577671489
3
444819690 3519 48280371 117052060
3
729584406 8367 456501516 557088265
3
629207296 3735 112288653 309364482
3
775589210 6930 266348458 604992807
3
249414894 1999 34827655 127026562
3
566377385 227 424126063 478693454
3
960442940 572344654 77422042 406189391
1
291071313 592207814 6792338 181083636
1
191971162 306112722 18212391 188328807
1
609162932 300548167 21640850 411089609
2
645010014 34698301 217620581 416292490
3
51474721 867363452 12231088 43489285
1
484381636 927869638 57278216 175514226
1
491259590 529594367 305425951 326414536
1
733405771 830380469 19971607 389270995
1
446237720 920085248 296916273 439113596
1
12 6 3 10
2
25 2 8 11
2
17 8 3 15
2
9 2 4 7
2
6 7 5 6
1
13 2 1 6
1
15 8 10 14
1
27 2 5 13
2
14 8 2 12
2
61 1 10 38
1
15 6 7 15
1
100 1 2 15
1
10 1 4 5
1
6 3 1 6
1
4 3 3 4
2
5 2 1 5
1
7 3 1 1
1
7 3 1 2
1
7 3 1 3
1
7 3 1 4
2
7 3 1 5
2
7 3 1 6
1
7 3 1 7
1
7 3 2 2
1
7 3 2 3
1
7 3 2 4
2
7 3 2 5
2
7 3 2 6
2
7 3 2 7
2
7 3 3 3
1
7 3 3 4
2
7 3 3 5
2
7 3 3 6
2
7 3 3 7
2
7 3 4 4
1
7 3 4 5
1
7 3 4 6
1
7 3 4 7
1
7 3 5 5
1
7 3 5 6
1
7 3 5 7
2
7 3 6 6
1
7 3 6 7
2
7 3 7 7
1
8 3 1 1
1
8 3 1 2
1
8 3 1 3
1
8 3 1 4
2
8 3 1 5
2
8 3 1 6
1
8 3 1 7
2
8 3 1 8
1
8 3 2 2
1
8 3 2 3
1
8 3 2 4
2
8 3 2 5
2
8 3 2 6
2
8 3 2 7
2
8 3 2 8
2
8 3 3 3
1
8 3 3 4
2
8 3 3 5
2
8 3 3 6
2
8 3 3 7
3
8 3 3 8
2
8 3 4 4
1
8 3 4 5
1
8 3 4 6
1
8 3 4 7
2
8 3 4 8
1
8 3 5 5
1
8 3 5 6
1
8 3 5 7
2
8 3 5 8
2
8 3 6 6
1
8 3 6 7
2
8 3 6 8
2
8 3 7 7
1
8 3 7 8
1
8 3 8 8
1
n = input().split()
m = int(n[1])
a = int(n[2])
b = int(n[3])
n = int(n[0])
a = m - a % m + 1
b = b % m

res = 3
if a == m:
    res -=1
if b == 0:
    res -=1
if a + b == m and not b ==0:
    res = 2
print(res)