#include <bits/stdc++.h>
using namespace std;
 
int main() {
	// your code goes here
	int n;
	cin>>n;
	vector<int>arr(n);
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	int maxi=0;
	for(int i=0;i<n;i++){
		unordered_map<int,int>mp;
		for(int j=i;j<n;j++){
			if(mp.find(arr[j])==mp.end()){
				int len=j-i+1;
				maxi=max(maxi,len);
			}
			else{
				break;
			}
		}
	}
	cout<<"The maximum sum is:"<<maxi;
	return 0;
}