#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
// #include <atcoder/all>
// using namespace atcoder;

int main(){
    int n, w;
    cin >> n >> w;
    int ans = n/w;
    cout << ans << endl;
}

#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<iomanip>
#include<regex>
using namespace std;
#define int long long
const int mod=1e9+7;
bool pri[1000001],squf[1000001],even[1000001];
signed main(){
	int l,r;
	cin>>l>>r;
	for(int i=2;i<=r;i++)
		pri[i]=squf[i]=even[i]=1;
	for(int i=2;i<=r;i++){
		if(!pri[i])
			continue;
		for(int j=i;j<=r;j+=i){
			if(j!=i)
				pri[j]=0;
			even[j]=!even[j];
		}
		for(int j=i*i;j<=r;j+=i*i)
			squf[j]=0;
	}
	int ans1=0,ans2=0;
	for(int g=2;g<=r;g++){
		if(!squf[g])
			continue;
		int a=r/g-(l-1)/g;
		a=a*(a-1)/2;
		if(even[g])
			ans1-=a;
		else
			ans1+=a;
	}
	for(int g=max(2ll,l);g<=r;g++)
		ans2+=r/g-1;
	cout<<(ans1-ans2)*2<<endl;
}