#include using namespace std; int main(){ int n , m; cin >> n >> m; int ans = max(0,n-1) + max(0,m-1); cout << ans << endl; }