#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef vector vi; typedef pair pii; #define MP make_pair #define PB push_back #define inf 1000000007 #define rep(i,n) for(int i = 0; i < (int)(n); ++i) #define all(x) (x).begin(),(x).end() template void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } template inline bool chmax(T &a, T b){ if(a inline bool chmin(T &a, T b){ if(a>b){ a = b; return true; } return false; } int main(){ int n,m; cin >> n >> m; if(n%2==0&&m%2==0){ cout << 0 << endl; return 0; } if(n%2==1&&m%2==0){ swap(n,m); } if(n%2==0&&m%2==1){ cout << 1 << endl; }else{ cout << m/4 + n/4 << endl; } return 0; }