LearnPy Hub
← Arena
EasyRating 900

Make It Even

You may reverse any prefix of the digits of n (a prefix of length l becomes reversed), any number of times. Print the fewest operations to make n even, or -1. 0 operations if it is already even.

Input

One integer n (1 ≤ n ≤ 10⁹).

Output

One integer.

Sample 1

Input
3876
Output
0

Sample 2

Input
387
Output
2
solution.py
Output appears here
Make It Even · Python Arena problem · LearnPy Hub