/*
AUTORE: Manuel Vichi
Sensori
*/
#include <iostream>
#include <cmath>
using namespace std;
int main(void){
    int b0, b1, b2, b3, b4, b5, b6, b7;
    
        do
        {
            cout << "b0 OFF/ON (0/1) " << endl;
            cin >> b0;
        } while(b0 < 0 || b0 > 1);
        
        cout << endl << endl;
        
        do
        {
            cout << "b1 OFF/ON (0/1) " << endl;
            cin >> b1;
        } while(b1 < 0 || b1 > 1);
        
        cout << endl << endl;
                
        do
        {
            cout << "b2 OFF/ON (0/1) " << endl;
            cin >> b2;
        } while(b2 < 0 || b2 > 1);
        
        cout << endl << endl;

        do
        {
            cout << "b3 OFF/ON (0/1)" << endl;
            cin >> b3;
        } while(b3 < 0 || b3 > 1);
        
        cout << endl << endl;
        
        do
        {
            cout << "b4 OFF/ON (0/1)" << endl;
            cin >> b0;
        } while(b4 < 0 || b4 > 1);
        
        cout << endl << endl;
        
        do
        {
            cout << "b5 OFF/ON (0/1)" << endl;
            cin >> b5;
        } while(b5 < 0 || b5 > 1);
        
        cout << endl << endl;
        
        do
        {
            cout << "b6 OFF/ON (0/1)" << endl;
            cin >> b6;
        } while(b6 < 0 || b6 > 1);
        
        cout << endl << endl;
        
        do
        {
            cout << "b7 OFF/ON (0/1)" << endl;
            cin >> b7;
        } while(b7 < 0 || b7 > 1);
        
        cout << endl << endl;
        
        if(b3==1 or b6==1)
        b7=1;
        int btot =b7pow(2,7)+b6pow(2,6)+b5pow(2,5)+b4pow(2,4)+b3pow(2,3)+b2pow(2,2)+b1pow(2,1)+b0pow(2,0);
        cout << btot;
        
        
    
    return 0;
}