1055
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
 
using namespace std;
 
#define INPUT_FILE "xo.in"
#define OUTPUT_FILE "xo.out"
 
int main(void)
{
 
#ifdef ALEX
    freopen("input.in", "r", stdin);
    freopen("output.out", "w", stdout);
#else
//    freopen(INPUT_FILE, "r", stdin);
//    freopen(OUTPUT_FILE, "w", stdout);
#endif
 
    int _n,n,_k;
    int i = 2;
    long long sum = 1;
    map< int, int > m;
 
    cin >> _n;
 
    for(int j = 1; j <= _n; j++)
    {
        int n = j;
        i = 2;
        while( n != 1 )
        {
            if( i >= ((int)sqrt((double)n) + 1) )
            {
                m[n]++;
                break;
            }
            while( n % i == 0 )
            {
                m[i] ++;
                n = n/i;
            }
            i++;
        }
    }
 
    cin >> _k;
    for(int j = 1; j <= _k; j++)
    {
        int n = j;
        i = 2;
        while( n != 1 )
        {
            if( i >= ((int)sqrt((double)n) + 1) )
            {
                m[n]--;
                break;
            }
            while( n % i == 0 )
            {
                m[i] --;
                n = n/i;
            }
            i++;
        }
    }
 
    for(int j = 1; j <= (_n - _k); j++)
    {
        int n = j;
        i = 2;
        while( n != 1 )
        {
            if( i >= ((int)sqrt((double)n) + 1) )
            {
                m[n] --;
                break;
            }
            while( n % i == 0 )
            {
                m[i] --;
                n = n/i;
            }
            i++;
        }
    }
 
    long long r = 0;
    for(map<int,int>::iterator it = m.begin(); it != m.end(); it++)
    {
        if((*it).second > 0)
            r ++;
    }
 
    cout << r;
 
    return 0;
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.