{"raw_statement":[{"iden":"problem statement","content":"Given is a positive integer $N$, where none of the digits is $0$.  \nLet $k$ be the number of digits in $N$. We want to make a multiple of $3$ by erasing at least $0$ and at most $k-1$ digits from $N$ and concatenating the remaining digits without changing the order.  \nDetermine whether it is possible to make a multiple of $3$ in this way. If it is possible, find the minimum number of digits that must be erased to make such a number."},{"iden":"constraints","content":"*   $1 \\le N \\lt 10^{18}$\n*   None of the digits in $N$ is $0$."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$"},{"iden":"sample input 1","content":"35"},{"iden":"sample output 1","content":"1\n\nBy erasing the $5$, we get the number $3$, which is a multiple of $3$. Here we erased the minimum possible number of digits - $1$."},{"iden":"sample input 2","content":"369"},{"iden":"sample output 2","content":"0\n\nNote that we can choose to erase no digit."},{"iden":"sample input 3","content":"6227384"},{"iden":"sample output 3","content":"1\n\nFor example, by erasing the $8$, we get the number $622734$, which is a multiple of $3$."},{"iden":"sample input 4","content":"11"},{"iden":"sample output 4","content":"\\-1\n\nNote that we must erase at least $0$ and at most $k-1$ digits, where $k$ is the number of digits in $N$, so we cannot erase all the digits.  \nIn this case, it is impossible to make a multiple of $3$ in the way described in the problem statement, so we should print `-1`."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}