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
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<cstring>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
#include<time.h>
#include<cassert>

using namespace std;
#define ll long long
#define ld long double
#define int long long
#define all(a) (a).begin(),(a).end()
#define EPS (1e-13)
#define fs first
#define sc second
#define xx first
#define yy second.first
#define zz second.second
#define H pair<int, int>
#define P pair<int, pair<int, int>>
#define Q(i,j,k) mkp(i,mkp(j,k))
#define rep(i,n) for(int (i) = 0 ; (i) < (n) ; (i)++)
#define mkp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define crdcomp(b) sort(all((b)));(b).erase(unique(all((b))),(b).end())
#define ssp(i,n) (i==n-1?"\n":" ")
const int mod = 1e9 + 7;
const int Mod = 998244353;
const ll Inf = 3 * 1e18;
const int inf = 15 * 1e8;
ll read() {
	ll u, k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j % i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}
ll bcount(ll x) {
	int sum = 0;
	for (int i = 0; i < 20; i++)
		if ((1ll << i) & x) sum++;
	return sum;
}
/*const int fn_ = 2000000;
ll fact_[fn_], comp_[fn_];
ll comb(ll x, ll y, ll Mod = mod) {
	if (!fact_[0]) {
		fact_[0] = 1; comp_[0] = 1;
		for (int i = 1; i < fn_; i++) {
			fact_[i] = fact_[i - 1] * i % Mod;
			comp_[i] = mod_pow(fact_[i], Mod - 2, Mod);
		}
	}
	if (x < y) return 0;
	return fact_[x] * comp_[x - y] % Mod * comp_[y] % Mod;
}*/
//---------------------------------------------------
int n, m;
int a[200000];
int dp[200000][3];
signed main() {
	cin >> m >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	int ans = 0;
	if (m == 2) {
		dp[0][3 - a[0]] = 1;
		for (int i = 1; i < n; i++) {
			dp[i][a[i]] = dp[i - 1][3 - a[i]];
			dp[i][3 - a[i]] = dp[i - 1][a[i]] + 1;
		}
		cout << min(dp[n - 1][1], dp[n - 1][2]) << endl;
		return 0;
	}
	for (int i = 0; i < n;) {
		int j = i;
		while (j < n && a[i] == a[j]) {
			j++;
		}
		ans += (j - i) / 2;
		i = j;
	}
	cout << ans << endl;
}
