{"scoring":null,"notes":"In the example, the values of $s$ on the four steps are\r\n$740\\,740$, $139\\,655$, $469\\,353$, and~$880\\,395$.\r\n","legend":"Lina the Magician claims that a common modern computer\r\ncan easily perform a hundred billion operations per second!\r\nTo prove it, she proposes to run the following calculations.\r\n\r\nLet $V$ be a set of integers, initially empty.\r\nWe are given the starting value of the integer $s$.\r\nMake $n$ steps described below:\r\n\r\n\\begin{itemize}\r\n\\item $s \\leftarrow (s \\cdot 618\\,023 + 1) \\bmod 999\\,983$;\r\n\\item find the number of distinct pairs of integers in $V$\r\nthat have the sum $s$;\r\n\\item if this number is even, insert $s$ into the set $V$.\r\n\\end{itemize}\r\n\r\nHow many elements will there be in $V$ after $n$ steps?\r\n\r\nFormally: on each step, we count the number of pairs $(a, b)$\r\nwhere $a \\in V$, $b \\in V$, $a \\le b$ and $a + b = s$.\r\n","authorLogin":"gassa","language":"english","timeLimit":2000,"output":"Print a single integer: the size of set $V$ after $n$ steps.\r\n","inputFile":"stdin","outputFile":"stdout","input":"The first line contains integers $n$ and $s$\r\n($1 \\le n \\le 200\\,000$; $0 \\le s < 999\\,983$; $s \\ne 742\\,681$).\r\n","authorName":"Ivan Kazmenko","sampleTests":[{"output":"3\r\n","input":"4 179629\r\n","inputFile":"example.01","outputFile":"example.01.a"}],"name":"Sums of Two","interaction":null,"memoryLimit":1073741824,"tutorial":""}