#include #include using namespace std; int main(void) { int n, i, ans; long long int pa[100005] = {0}; cin >> n; ans = n; for (i = 0; i < n; i++) { cin >> pa[i]; } sort(pa, pa + n); for (i = 0; i < n - 1; i++) { if (pa[i] == pa[i + 1]) ans -= 2; if (pa[i] == pa[i + 1] && pa[i + 1] == pa[i + 2]) ans += 1; } if (pa[0] == pa[n - 1]) ans = 0; cout << ans << endl; return 0; }