#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	int n;
	cin>>n;
	int l,r,ans=0;
	while(n--){
		cin>>l>>r;
		ans+=(l+r)*(r-l+1)/2;
	}
	cout<<ans;
	return 0;
}
#include<bits/stdc++.h>
#define DONTSYNC ios_base::sync_with_stdio(false);   cin.tie(NULL); cout.tie(NULL) //dont use stdio with iostream functions //input and output are out of order now!
#define TEST unsigned long long T; cin>>T; while(T--)  //loop over each testcase
#define endl "\n"
#define fori(a,start,end) for(int a=start;a<end;a++)
#define forll(a,start,end) for(long long a=start;a<end;a++)
#define forull(a,start,end) for(unsigned long long a=start;a<end;a++)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

void solve(){
    /* code */
    double sx,sy,gx,gy; cin>>sx>>sy>>gx>>gy;
    cout<<fixed<<setprecision(9)<< sx+sy*(gx-sx)/(gy+sy);
}

int main()
{
    DONTSYNC;
    // TEST{
        solve();
    // }
    return 0;
}
