Loto#812

Loto

3 seconds
256 megabytes
Very easy

To play "Loto," cards are used that satisfy the following conditions:

Example of a card:

Determine the number of different possible cards.

Input

The first line contains two integers and (3 \le K \le 9, 1 < K < N). Each of the next lines contains two non-negative integers a_i and b_i (not exceeding ). It is guaranteed that a_i < b_i, b_i < a_{i+1}, and b_i - a_i < 20.

Output

Output a single integer — the total number of different cards.

Examples

Example 1

Loading
Loading