#include <bits/stdc++.h>
int main(int argc, char** argv) {
  std::vector<int> v;
  int i;
  while (std::cin >> i) {
    v.push_back(i);
  }
  int lcm = 1;
  for (auto e : v) {
    if (lcm % e == 0) {
      continue;
    }
    lcm *= e;
  }
  std::cout << lcm - 1 << std::endl;
  return 0;
}
