this year Alex finish school firstyear student Berland State University for total surprise study program attend physical education lesson the end term soon unfortunately Alex have not attend single lessonsince Alex do not want expel want know number work day leave end term attend physical education lesson day but BSU calculate number work day complicate matterThere n day leave end term number 1 n initially work day then university staff sequentially publish q order each order characterise number l r k if k1 day l r inclusive nonworking day if day work day previous order day nonworke day if k2 day l r inclusive working day if day nonworke day previous order day work day help Alex determine number work day leave order