#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define Rep(i,n) for(int i=0;i<=(int)n;i++)


int main(){
  ll n;
  int m;
  cin>>n>>m;
  if(m==0){
    cout<<1<<endl;
    return 0;
  }
  vector<ll> a(m);
  for(int i=0;i<m;i++){
    cin>>a.at(i);
  }
  sort(a.begin(),a.end());
  ll b=a.at(0)-1;
  ll v=-1;
  if(b==0){
    for(int i=0;i<m-1;i++){
      b=a.at(i+1)-a.at(i)-1;
      if(b!=0){
        v=i;
        break;
      }
    }
  }
  if(b==0){
    if(n==m){
      cout<<0<<endl;
      return 0;
    }
    cout<<1<<endl;
    return 0;
  }
  for(int i=0;i<m-1;i++){
    if(a.at(i+1)-a.at(i)-1==0)continue;
    b=min(b,a.at(i+1)-a.at(i)-1);
  }
  if(n-a.at(m-1)>0)b=min(b,n-a.at(m-1));
  ll count=0;
  if((a.at(0)-1)%b==0)count+=(a.at(0)-1)/b;
  else count+=(a.at(0)-1)/b+1;
  for(int i=0;i<m-1;i++){
    if((a.at(i+1)-a.at(i)-1)%b==0)count+=(a.at(i+1)-a.at(i)-1)/b;
    else count+=((a.at(i+1)-a.at(i)-1)/b)+1;
  }
  if((n-a.at(m-1))%b==0)count+=(n-a.at(m-1))/b;
  else count+=((n-a.at(m-1))/b)+1;
  cout<<count<<endl;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INFint = 1e9+1;
const ll INFll = (ll)1e18+1;
const int MOD=998244353;
const ll MODD = 1000000007;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
    ll t,p;
    cin>>t>>p;
    ll cnt=0;
    ll idt=0;
    vector<ll>ans;
    while(idt<=100){
        if(((cnt+t)/100)%10!=(cnt/100)%10){
            ans.push_back((idt+(ll)((idt)*((double)t/100.0)))+1);
        }
        cnt+=t;
        idt++;
    }
    ll num=ans.size();
    ll row=(p-1)/num;
    ll shun=0;
    shun=row*(100+t)+ans[(p-1)%num];
    cout<<shun<<endl;
}