#include<stdio.h> int main(void) { int n; int i = 0; unsigned int count = 0; while (i<32) { scanf("%d", &n); i++; if ((n != 0) && (n != 1)) { break; } if (count) { count = count << 1; } if (n == 1) { count++; } } printf("%u",count); return 0; }