#include<iostream>
using namespace std;
unsigned long long int Zaok(long long int a,long long int b)
{
    int c=a/b;
    if(a%b>0)
    c++;
    return c;
}
main()
{
      unsigned long long int p,q,r,L,R,n,j=0;
      cin>>p;
      cin>>q;
      cin>>r;
      cin>>L;
      cin>>R;
      for(unsigned long long int i=L;i<=R;i++)
      {
               n=Zaok(i,p)+Zaok(i,q)+Zaok(i,r);
               if(i>=n)
               j++;
      }
      cout<<j;
}