{"raw_statement":[{"iden":"problem statement","content":"Given is a string $S$ consisting of digits from `1` through `9`.\nFind the number of pairs of integers $(i,j)$ ($1 ≤ i ≤ j ≤ |S|$) that satisfy the following condition:\nCondition: In base ten, the $i$\\-th through $j$\\-th characters of $S$ form an integer that is a multiple of $2019$."},{"iden":"constraints","content":"*   $1 ≤ |S| ≤ 200000$\n*   $S$ is a string consisting of digits from `1` through `9`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$S$"},{"iden":"sample input 1","content":"1817181712114"},{"iden":"sample output 1","content":"3\n\nThree pairs - $(1,5)$, $(5,9)$, and $(9,13)$ - satisfy the condition."},{"iden":"sample input 2","content":"14282668646"},{"iden":"sample output 2","content":"2"},{"iden":"sample input 3","content":"2119"},{"iden":"sample output 3","content":"0\n\nNo pairs satisfy the condition."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}