#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
int l=1,r=2e9,best=-1;
while(l<=r){
int mid=(l+r)/2;
if(mid==a+b){
best=mid;
break;
}else if(mid<a+b){
l=mid+1;
}else{
r=mid-1;
}
}
cout<<best;
return 0;
}