#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#define For(i, l, r) for (i = int64(l); i <= int64(r); i++)
#define Fo(i, n) For(i, 1, n)
#define Rof(i, r, l) for (i = int64(r); i >= int64(l); i--)
#define Ro(i, n) Rof(i, n, 1)
#define clr(a) memset(a, 0, sizeof(a))
#define cpy(a, b) memcpy(a, b, sizeof(b))
#define fc(a, ch) memset(a, ch, sizeof(a))

typedef long long int64;

#define T1 template <class A>
#define T2 template <class A, class B>
#define T3 template <class A, class B, class C>
#define T4 template <class A, class B, class C, class D>
inline void read(char &x)
{
    do
        x = getchar();
    while (x <= ' ');
}
inline void read(char *s)
{
    char ch;

    do
        ch = getchar();
    while (ch <= ' ');
    while (ch > ' ')
    {
        (*s) = ch;
        s++;
        ch = getchar();
    }
    (*s) = 0;
}
inline void read(std::string &s)
{
    char ch;

    do
        ch = getchar();
    while (ch <= ' ');
    while (ch > ' ')
    {
        s.push_back(ch);
        ch = getchar();
    }
}
T1 inline void readint(A &x)
{
    bool neg = false;
    char ch;

    do
        ch = getchar();
    while (ch <= ' ');
    if (ch == '-')
    {
        neg = true;
        ch = getchar();
    }
    x = 0;
    while (ch > ' ')
    {
        x = x * 10 + (ch & 15);
        ch = getchar();
    }
    if (neg)
        x = -x;
}
inline void read(int &x) { readint(x); }
inline void read(int64 &x) { readint(x); }

T2 inline void read(A &a, B &b)
{
    read(a);
    read(b);
}
T3 inline void read(A &a, B &b, C &c)
{
    read(a);
    read(b);
    read(c);
}
T4 inline void read(A &a, B &b, C &c, D &d)
{
    read(a);
    read(b);
    read(c);
    read(d);
}
inline void writeln() { putchar('\n'); }
T1 inline void write(A x)
{
    static char buf[20];
    int top = 0;

    if (!x)
    {
        putchar('0');
        return;
    }
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    while (x)
    {
        buf[++top] = (x % 10) | 48;
        x /= 10;
    }
    while (top)
        putchar(buf[top--]);
}
T1 inline void write_(A x)
{
    write(x);
    putchar(' ');
}
T1 inline void writeln(A x)
{
    write(x);
    putchar('\n');
}
T2 inline void write(A a, B b)
{
    write_(a);
    write(b);
}
T2 inline void writeln(A a, B b)
{
    write_(a);
    writeln(b);
}
T3 inline void writeln(A a, B b, C c)
{
    write_(a);
    write_(b);
    writeln(c);
}
T4 inline void writeln(A a, B b, C c, D d)
{
    write_(a);
    write_(b);
    write_(c);
    writeln(d);
}
#undef T1
#undef T2
#undef T3
#undef T4


const int P[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71};
const int PN = sizeof(P) >> 2;
const int full = (1 << PN) - 1;

int64 a, b;
int64 f[1 << PN | 5];

int main() {
	int64 i, ans;
	int j, x;
	
	read(a, b);
	
	f[0] = 1;
	For(i, a, b) {
		x = 0;
		For(j, 0, PN - 1)
			if(i % P[j] == 0)
				x |= 1 << j;
		Rof(j, full, 0)
			if(!(j & x))
				f[j | x] += f[j];
	}
	
	ans = 0;
	For(j, 0, full)
		ans += f[j];
	writeln(ans);
	return 0;
}
#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long int
#define ld long double
using namespace std;

ll mod = 1000000007;


void solve()
{
  ll n;
  cin >> n;


  if (n == 1)
  {
    cout << 0 << endl;
    return;
  }

  cout << n - 1 << endl;



}






int main()
{

// #ifndef ONLINE_JUDGE

//   freopen("inputs.txt", "r", stdin);

//   freopen("outputs.txt", "w", stdout);
// #endif
  fast;
  ll t, n, a, b, c, e, f, g, temp, m;
// cin >> t;

  t = 1;

  for (int i = 0; i < t; i++)
    solve();

  return 0;
}