G. Gatekeeping
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
1&(2|3|4)&5
Output
4
Input
1&(2|3|(4&5)|6)&(7|8|9)
Output
20