{"raw_statement":[{"iden":"problem statement","content":"We have a grid with $n$ rows and $7$ columns. We call it a calendar. The cell at $i$\\-th row and $j$\\-th column is denoted $(i, j)$.  \n\n![image](https://atcoder.jp/img/s8pc-4/1bef402eeaddb846eb2ea4d386a1ed3d.png)\n\nInitially, each cell at $(i, j)$ contains the integer $7i + j - 8$, and each cell is white.  \n  \nSnuke likes painting, so he decided integer $m$, and did $q$ operations with a calendar.  \n・In $i$\\-th operation, he paint black on the cell in which an integer is written such remainder of dividing by $m$ is $a_i$.  \n  \nPlease count the number of connected white parts.  \nNote that if two adjacent cells are white, the cells belong to the same connected part."},{"iden":"input format","content":"The input format is following:  \n\n$n$ $m$ $q$\n$a_1$ $a_2$ ... $a_q$"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}