#include <iostream>

#include <iostream>
using namespace std;
#include<cmath>
#include<algorithm>
  static int zaokrugli(int i,int p)
 {
 	if(i%p==0) return i/p;
 	else
 	return i/p+1;
}
 int main(int argc, char** argv)
 {
	int p,q,r,L,R;
 	cin>>p>>q>>r>>L>>R;
 	int s=0;
 	for(int i=L;i<=R;i++)
	 {
	 	int z=0;
	 	z=zaokrugli(i,p)+zaokrugli(i,q)+zaokrugli(i,r);
	 	if(z==i)
	 	s++;
	 	
	 }
	 cout<<s;
}