Contest T-shirts

Segtree has $ M $ contest T-shirts.

He decided to spend $ N $ days on the contest T-shirt alone, and told $ i = 1, 2, 3, \ dots, N $ "$ A_i $ T-shirt on the $ i $ day." I made a plan for $ N $ to wear.

However, if you keep the current plan, you may not be able to do the laundry in time, so I would like to change the plan if necessary so that I will not wear the same clothes for two consecutive days.

Find the minimum number of plans that need to be changed. It can be proved that the conditions can always be met by changing the plan under the given constraints.

input

Input is given from standard input in the following format.


$ M $ $ N $
$ A_1 $ $ A_2 $ $ \ ldots $ $ A_N $


output

Output the minimum number of plans that need to be changed.

However, insert a line break at the end.

Constraint

* $ 2 \ leq M \ leq 10 ^ 9 $
* $ 1 \ leq N \ leq 10 ^ 5 $
* $ 1 \ leq A_i \ leq M $
* All inputs are integers.



Input example 1


twenty three
2 2 1


Output example 1


1


Input example 2


3 6
1 1 1 2 2 3


Output example 2


2






Example

Input

2 3
2 2 1


Output

1
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define pb push_back
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int kaijo[2000010];
struct edge{int to,cost;};
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
void init_fact(){
    kaijo[0]=1;
    for(int i=1;i<=2000000;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=MOD;
    }
}
int modpow(int a,int b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%MOD;
    int memo=modpow(a,b/2);
    return memo*memo%MOD;
}
int comb(int a,int b){
    if(!kaijo[0])init_fact();
    return kaijo[a]*modpow(kaijo[a-b],MOD-2)%MOD*modpow(kaijo[b],MOD-2)%MOD;
}
int inv(int x){
    x=modpow(x,MOD-2);
    return x;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){
    double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
    double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
    double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
    double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
    return tc*td<0&&ta*tb<0;
}
double dist(double ax,double ay,double bx,double by){
    return sqrt((bx-ax)*(bx-ax)+(ay-by)*(ay-by));
}
int m,n,a[100010];
signed main(){
    cin>>m>>n;
    rep(i,n)cin>>a[i];
    if(m==2){
        int ans=INF,cnt=0;
        rep(i,n){
            if(i%2==0&&a[i]==2)cnt++;
            if(i%2==1&&a[i]==1)cnt++;
        }
        ans=min(ans,cnt);
        cnt=0;
        rep(i,n){
            if(i%2==0&&a[i]==1)cnt++;
            if(i%2==1&&a[i]==2)cnt++;
        }
        ans=min(ans,cnt);
        cout<<ans<<endl;
        return 0;
    }
    int ans=0;
    rep(i,n){
        if(i){
            if(a[i]==a[i-1]){
              ans++;
              a[i]=-i;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

