include [HTML_REMOVED]
using namespace std;
const int N = 100010;
int a[N], count[N];
int n, ans;
int main() {
scanf(“%d”, &n);
for (int i = 0; i < n; i) {
scanf(“%d”, &a[i]);
}
for (int i = 0, j = 0; j < n; j) {
count[a[j]] ;
while (count[a[j]] > 1) {
count[a[i]] –;
i;
}
ans = max(ans, j - i + 1);
}
printf(“%d”, ans);
return 0;
}