← Home
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll;
//-----------------------------------------------------------------------------
#define rango ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long , long long>
#define vec vector
#define lc            id<<1
#define rc            lc|1
#define F first
#define S second
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define from(x,y,i)  for(int i=x;i<=y;i++)
#define fromz(x,y,i) for(int i=x;i<y;i++)
#define refor(x,y,i) for(int i=x;i>=y;i--)
//-----------------------------------------------------------------------------
ll poww(ll a, ll b) {
    return (!b ? 1 : (b & 1 ? a * poww(a * a, b / 2) : poww(a * a, b / 2) ) );
}
//-----------------------------------------------------------------------------
const int N=2e5;
const ll mod=1e9+7;
//-----------------------------------------------------------------------------
ll n;
int k,a[N];
int b[102][N];
bool m[102][N];
 
ll f(ll x,int y){
	if(y==k+1)return 0;
	if(x<N&&m[y][x])return b[y][x];
	ll p=x/a[y]+f(x,y+1)-f(x/a[y],y+1);
	if(x<N)m[y][x]=1,b[y][x]=p;
	return p; 
}
 
int main(){
	rango
	cin>>n>>k;
	from(1,k,i)cin>>a[i];
	sort(a+1,a+1+k,greater<ll>());
	ll ans=f(n,1);
	cout<<n-ans<<endl;
}