#include using namespace std; using ll=long long; template inline bool chmin(T&x,U y){if(x>y){x=y;return true;}return false;} template inline bool chmax(T&x,U y){if(x=0;--i) #define iFr(i,n) for(int i=(n);i>0;--i) int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,a; cin>>n>>a;--a; vector b(1,a); fr(i,n-1){ cin>>a;--a; if(a!=b.back()) b.emplace_back(a); } n=b.size(); set st; for(auto&i:b) st.insert(i); if(st.size()