Example:
1. Input = 001. Output=0, because 00 in 001 is invalid.
2. Input = 01?. Output=2, because we can get: 010, 012.
3. Input = ?1?. Output=4, because we can get: 010, 012, 110, 112.
4. Input = ?1??. Output=8, because we can get: 0101, 0102, 0120, 0121, 2101, 2102, 2120, 2121.