#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll x,y; cin>>x>>y; if((y-x)%2==0){ cout<<(y-x)/2; } else{ cout<<(y-x)/2+1; } return 0; }