#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int A,B,C,maks;
    cout<<"unesite broj bodova u drugom kolu"<<endl;
    cin>>B;
    cout<<"unesite broj bodova u trecem kolu"<<endl;
    cin>>C;
    if (B<0)
        return 1;
    if (C<0 || C>500)
        return 1;
    if (B+C>256 || B+C==256)
        A=0;
    else if (B+C<256)
    {
        maks=max(B,C);
        A=256-maks;
    }
    cout<<A;
    return 0;
}