#include<iostream>
#include<cmath>
using namespace std;
int main()
{
  int pocetok,kraj,b=0,zbir=0;
  cin>>pocetok>>kraj;
  for(int a=1;a<kraj+1;a++){
    b+=1;
    if(b==4){
        b=1;
    }
    if(a>pocetok){
       zbir+=b; 
    }
  }
  cout<<zbir<<endl;
    
    
 return 0;   
}