#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, k, s;
  cin >> a >> b;
  if (a < b) {
    a = k;
    a = b;
    b = k;
  }
  while (a != b) {
    a++;
    c++;
    if (a == b) break;
    b++;
    d++;
  }
  for (int i = 0; i < a; i++) s = c + i;
  for (int i = 0; i < b; i++) s = d + i;
  cout << s;
}
