You are given a string s consisting of n lowercase Latin letters. You have to type this string using your keyboard.Initially, you have an empty string. Until you type the whole string, you may perform the following operation:  add a character to the end of the string. Besides, at most once you may perform one additional operation: copy the string and append it to itself.For example, if you have to type string abcabca, you can type it in 7 operations if you type all the characters one by one. However, you can type it in 5 operations if you type the string abc first and then copy it and type the last character.If you have to type string aaaaaaaaa, the best option is to type 4 characters one by one, then copy the string, and then type the remaining character.Print the minimum number of operations you need to type the given string.

The first line of the input containing only one integer number n (1 ≤ n ≤ 100) — the length of the string you have to type. The second line containing the string s consisting of n lowercase Latin letters.

Print one integer number — the minimum number of operations you need to type the given string.

NoteThe first test described in the problem statement.In the second test you can only type all the characters one by one.

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <bitset>
using namespace std;
typedef long long ll;

int main()
{
    int n;
    while(cin>>n){
        char s[120];
        int a[120]={0};
        cin >> s;
        int i,j,x,y;
        i = 0;
            for(j = 1;j < n;j++){
                if(s[0]==s[j]){
                    int ans = 1;
                    for(x=i+1,y=j+1;y<n;x++,y++){
                        if(x==j){
                            a[j] = ans;
                            break;
                        }
                        if(s[x]!=s[y]){
                            a[j] = ans;
                            break;
                        }
                        else ans++;
                    }
                    if(y==n){
                        a[j] = ans;
                    }
                }
            }
        int maxn = n;
            for(j = i+1;j < n;j++){
                if(j-i==a[j]){
                    maxn = min(maxn,n-a[j]+1);
                }
            }
            cout << maxn<<endl;
    }
    return 0;
}

#include<bits/stdc++.h>

#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)

#define si(a)           scanf("%d",&a)
#define sii(a,b)        scanf("%d %d",&a,&b)
#define siii(a,b,c)     scanf("%d %d %d",&a,&b,&c)
#define sl(a)           scanf("%lld",&a)
#define sll(a,b)        scanf("%lld %lld",&a,&b)
#define slll(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)

#define lli long long
#define m_p make_pair
#define p_b push_back

#define lim 10000000000
#define mod 100007
#define mx 100004
#define PI  3.141592654
using namespace std;

///** Direction Array **
//int dirx[]= {1,0,-1,0};
//int diry[]= {0,1,0,-1};

///*** Translator Functions**
//int ToInt(string s){int r = 0;stringstream sin(s);sin >> r;return r;}
//double ToDouble(string s) { double r = 0; stringstream sin(s); sin >> r; return r; }
//string ToString(int n)  {  string s;    stringstream convert;convert << n;s = convert.str();return s;}
///****My code goes from here***
string str;
int q,qq;
bool check(string nw,int p)
{
    int s=nw.size();
    if((p+1)%2==1) return false;
    if((p+1)%s!=0) return false;
    q=(p+1)/s;
    qq=s;
    if(q>2) return false;
    for(int i=0;i<p;i+=s)
    {
        for(int j=i,pp=0;j<i+s;j++,pp++)
        {
            if(str[j]!=nw[pp]) return false;
        }
    }
    return true;

}
int main()
{
    int n,ans=0;
    cin>>n;
    cin>>str;
    string p;
    for(int i=0;i<str.size();i++)
    {
        p+=str[i];
        int val=0;
        for(int ln=2;ln<=p.size()/2;ln++)
        {
            string tt;
            int cnt=0;
            for(int j=p.size()-1;j>=0;j--)
            {
                cnt++;
                tt+=p[j];
                if(cnt==ln) break;
            }
            reverse(tt.begin(),tt.end());

            if(check(tt,i)){
                val=max(val,ln);
            }
        }
        if(val!=0) ans=qq+(q-1);
        else ans=ans+1;
    }
    cout<<ans<<endl;

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    string a;
    cin>>a;
    int sum=0;
    while(a.size()!=1)
    {
        if(a.size()%2)
        {
            a.erase(a.size()-1,1);
            sum++;
            continue;
        }
        int flag=0;
        for(int i=0;i<a.size()/2;i++)
        {
            if(a[i]!=a[i+a.size()/2])
            {
                flag=1;
                break;
            }
        }
        if(!flag)
        {
            sum+=a.size()/2;
            break;
        }
        else
        {
            a.erase(a.size()-1,1);
            sum++;
        }
    }
    cout<<sum+1;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    ios :: sync_with_stdio(0);
    cin.tie(0);
    int n;
    string s;
    cin >> n >> s;
    int ans = n;
    for(int i = 1; i <= n - i; ++i)
    {
        string str1 = s.substr(0,i);
        string str2 = s.substr(i,i);
        if(str1 == str2)
            ans = n-i+1;
    }
    cout << ans;
    return 0;
}

#include<iostream>
#include<string>
using namespace std;
int main(){
  int n;
  cin>>n;
  int ma=0;
  string s;
  cin>>s;
 int t=0;
  int brojac=0;
  for(int i=s.size()/2;i>0;i--){
  t=0;
        brojac=0;
    for(int j=0;j<i;j++){
      if(s[j]==s[j+ i] ){

            if(t==0){
        brojac++;
            }

    }else{
        t=1;
    }
    }

    if(brojac>=i){

      cout<<i+(brojac/i) + (n-i*(brojac/i+1));
    return 0;
    }
  }

  cout<<n;
  }

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,len=1;
    string s;
    cin>>n>>s;
    for(int i=1; i<=n; i++)
        if(s.substr(0,i)==s.substr(i,i))///s.substr(i,j)表示从下标为i的位置截取j位字符，判断最长循环节
            len=i;
    cout<<n-len+1<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define pb push_back
#define ld long double
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e18 + 5;
const int mod = 1e9 + 7;
const int  N = 2e5 + 314;
const long double pi = 3.1415926535897932384626433832795;
vi a[N];
void solve(){
	int n, mx = 0;
	string s;
	cin>>n>>s;
	for(int i = 0; i < n; i++){
		int k = 0;
		for(int j = i; j < n&&k<i; j++){
			if(s[j]==s[k])k++;
			else break;
		}
		if(k==i)mx=max(mx, k);
	}
	cout<<n-mx+(mx!=0);
}
signed main(){
	speed;
	int t=1;
	//cin>>t;
	while(t--)solve();
}

#include <iostream>
#include <string>

using namespace std;

int max(int a, int b)
{
	return a >= b ? a : b;
}

int L(const string& input)
{
	int r = 0, offset = 1, size = 1;

	for (offset = 1; offset < input.size(); offset += 1)
	{
		int tmpa = 0, cnt = 0;
		while (tmpa + offset < input.size() && tmpa < offset && (input.at(tmpa) == input.at(tmpa + offset)))
		{
			tmpa += 1;
			cnt += 1;
		}
		if (cnt == offset)
		{
			r = max(r, cnt);
		}
	}

	return r;
}

int main(void)
{
	int ans = 0, tmp;
	string input;
	cin >> tmp;
	cin >> input;
	if (L(input) > 0)
	{
		cout << input.size() - L(input) + 1;
	}
	else
		cout << input.size();
	return 0;
}

#include<iostream>
#include<limits.h>
#include<algorithm>
#include<cstring>
#include<math.h>
#include<vector>
#include<stdio.h>
#include<string>
#include<utility>
#include<iomanip>
#include<queue>
#include<map>
#include<set>
#include<fstream>
#include<unordered_map>
using namespace std;
#define PI 3.14159265
#define PSET(x,y) fixed<<setprecision(y)<<x
#define pb push_back
#define pf push_front
#define mp make_pair
#define pii pair<int,int>
#define pli pair<ll,int>
#define pll pair<ll,ll>
#define pid pair<int,double>
#define vi vector<int>
#define ff first
#define ss second
#define ll long long
#define ull unsigned long long
#define SIZE 100010
#define MOD 1000000007
#define BIG 999999937

int main() {
    #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    string str;
    cin>>str;
    int res = n;
    for(int i=1;i<=n/2;i++) {
        if(str.substr(0,i)==str.substr(i,i))
            res=n-i+1;
    }
    cout<<res;

}

#include<bits/stdc++.h>
#include<cstdio>
using namespace std;

#define ll                      long long
#define pb(x)                   push_back(x)
#define sc(a)                   scanf("%lld",&a)
#define scn(a,b)                scanf("%lld %lld",&a,&b)
#define scd(a)                  scanf("%lf",&a)
#define pr(i,j)                 printf("Case %lld: %lld\n",i,j)
#define f(i,n)                  for(int i=0;i<n;i++)
#define ff(i,n)                 for(int i=1;i<=n;i++)
#define F(i,a,b)                for(int i=a;i<=b;i++)
#define mpp                     make_pair
#define pii                     pair<ll,ll>
#define sr(a)                   sort(a.begin(),a.end())
#define srg(a)                  sort(a.begin(),a.end(),greater<ll>())
#define rev(a)                  reverse(a.begin(),a.end())
#define vv(a)                   vector<ll>a
#define mp(a)                   map<ll,ll>a
#define pi                      2*acos(0.0)
#define f                       first
#define s                       second
#define gp                      ' '
#define ed                      endl
#define mod                     999855453
#define mxx                     10000005
#define eps                     0.0000000001
#define inf                     9999990000000999
#define mm(a,b)                 memset((a),(b),sizeof (a))
#define fastio                  {ios_base::sync_with_stdio(false);cin.tie(NULL);}

//ll dp[40005][3007];
//ll arr[mxx];

int main()
{
    ll n;
    sc(n);
    string a;
    cin>>a;
    ll p=0,c=inf,cc=0,f=0;
    ll x=n/2;
    //cout<<x<<ed;
    for(int i=x;i>=1;i--)
    {
        f=0;
        for(int j=i,k=0;j<2*x,k<i;j++,k++)
        {
            if(a[k]!=a[j]){f=1;break;}
        }
        if(f==0){c=n-i+1;break;}
    }
    //cout<<c<<ed;
    c=min(c,n);
    cout<<c<<ed;
    return 0;
}

#include <iostream>
#include <stdio.h>

#define inf 0x3f3f3f3f
#define pb push_back

using namespace std;

const int maxn = 1e5 + 300;

typedef long long ll;

bool mos = 0;
bool para = 0;
int n;
string s;

int f ( int i , int start , int size ){
  if( i == size) return size;
  if ( s[i] == s[start + i] ){
      f( i + 1, start , size);
  }else return 0;
}

int main() {

  // freopen("in","r",stdin);
  ios::sync_with_stdio(0); cin.tie(0);

  cin >> n;

  cin >> s;
  int ans = 0;
  para = 0;

  for(int i = 0 ;i < n;i++){
      ans = max ( ans, f( 0 , i + 1, i +  1));
  }

  bool faz = 0;
  if ( ans ) faz = 1;
  cout << (n - ans) + faz <<'\n';
}

#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define pb push_back

const int N = 1e5 + 11;

int main()
{

    int n;

    cin>>n;
    string s;
    cin>>s;

    int res=s.size();
    string t="";

    for (int j=0; j<n; j++)
    {
        t+=s[j];
        string d=t+t;
        int ps=0;
        for (int k=0; k<d.size(); k++)
            if (s[k]!=d[k]) ps=1;
        if (ps==0) res=min(res,(int)t.size()+1+(int)(s.size()-d.size()));

    }

    cout<<res<<endl;
}

#include <map>
#include <set>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>

using namespace std;

namespace StringInput
{
	/*
	O(N^2)
	*/
	int solve(const string &input)
	{
		int pl = input.size() / 2;
		for (; pl >= 2; pl--)
		{
			bool found = true;
			for (size_t i = 0; i < pl; i++)
			{
				if (input[i] != input[i + pl])
				{
					found = false;
					break;
				}
			}

			if (found)
			{
				return pl + 1 + (input.size() - pl * 2);
			}
		}

		return input.size();
	}
};

int main()
{
	int n;
	std::string input;

	std::cin >> n;
	std::cin >> input;
	std::cout << StringInput::solve(input);
}

      //Aim --> Blue on CF ....

      /*          IT IS GOING TO HAPPEN !
                      because
                       I AM GOING TO MAKE IT HAPPEN !      */

      // " every champion was once a contender who refused to give up " //
      // never give up !
      // vectorTango
      // reapedJuggler

      #include "bits/stdc++.h"

      #define DIEHOD ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
      #define ld long double
      #define ll long long
      #define all(A) begin(A) , end(A)
      #define sf(x)  scanf("%d",&x)
      #define sfl(x) scanf("%lld",&x)
      #define pf(x)  printf("%d\n",x)
      #define pfl(x) printf("%lld\n",x)
      #define pii    pair<lld , lld>
      #define rep(i , a , b)  for(lld i = a; i < b ; i++)
      #define reps(i , a , b) for(lld i = a ; i >= b ; i--)
      #define ftc(x)  cerr << #x << ": " << x << " \n" ;
      #define vvi   vector < pair <lld , lld> >
      #define lcm(a,b) ((a*b)/__gcd(a,b))
      #define lld long long int
      #define ulld unsigned long long int
      #define input lld* arr = new lld [n]
      #define input1 lld* brr = new lld [n]
      #define vec vector < lld >
      #define pb push_back
      #define ss second
      #define ff first
      #define inf (lld)(1e18)
      #define fin -999999999999999999
      #define mod 1000000007
      #define umap unordered_map
      #define mpp make_pair
      #define finish(x) cout << x << " ";
      #define tolower(s)   std::transform(s.begin(), s.end(), s.begin(),[](unsigned char c){ return std::tolower(c); });

      using namespace std;

    //   map <lld , vector<lld>> g;
    //   vec v;
    //   map<lld , bool> vis ; lld siz = 0 , ans = 0 ;

    //    void dfs(lld x){

    //    vis[x] = 1;

    //    for(auto i : g[x]){
    //     if(!vis[i]){
    //       dfs(i);
    //     }
    //    }

    //    return;
    //   }

    // lld pow1(ulld  a , ulld y){
    //   a %= mod;
    //   ulld  res = 1;

    //   while(y > 0){

    //     if(y & 1)
    //       res = (res*a)%mod;

    //     y = y >> 1;
    //     a = (a*a)%mod;
    //   }
    //   return res;
    // }

    // lld power(lld a , lld b){
    //   ulld res = 1;
    //   while(b){
    //      if(b & 1)
    //        res = res*a;

    //      b = b >> 1;
    //      a = a * a;
    //   }
    //   return res;
    // }

    // bool isPrime(lld n){
    //   if (n <= 1)  return false;
    //     if (n <= 3)  return true;
    //     if (n % 2 == 0 || n%3 == 0) return false;

    //       lld p = sqrt(n);

    //       for(lld i=5;i <= p ; i = i + 6)
    //         if (n % i == 0 || n % (i + 2) == 0)
    //           return false;
    //       return true;
    // }

    // bool sortbysec(const pair<lld ,lld > &a, const pair<lld ,lld > &b) {
    //   return (a.ss < b.ss);
    // }

  void sober(){
  lld n , x = 0 , a = 0 , b = 0 , y = 0 , sum = 0 , k = 0 , m = 0;
  cin >> n;
  string s;
  cin >> s;
  string lf = "";
  lld ans = 1;
  lf = lf + s[0];
  k = 1;

  while(k < n and s[k] != lf[0]){
    lf = lf + s[k];
    k++;
    ans++;
  }
  string zz = "";

  for(int i = k ; i < n ; i++){

    // cout << zz << "  " << i << "\n";

    if(i + lf.length() <= n and s.substr(i , (int)lf.length()) == lf){

        zz = lf;
        lf = lf + s[i];

    }

    else{
      lf = lf + s[i];
    }
  }

  // cout << zz << "  " << lf << "\n";

  bool foo = 0;
  ans = 0;
  for(int i = 0 ; i < n ; i++){

    if(i + zz.length() <= n and s.substr(i , (int)zz.length()) == zz and !foo and zz.length() >= 2){
        // cout << i << "  " << "\n";
        i += zz.length() - 1;
        foo = 1;
        ans++;
    }

    else{
      ans++;
    }
  }

  cout << ans << "\n";

  }

  signed main(){

    #ifndef ONLINE_JUDGE
        freopen("input.txt" , "r" , stdin) ;
        freopen("output.txt" , "w" , stdout) ;
    #endif

    DIEHOD;
    lld t = 1;
    // cin >> t;
    while(t--){
       sober();
    }
  }

  //  c0ded by :
  // - - - - - - - - - - - - - - - - - - - - - - s 0 b e r and s i m r a n

// Created by SAMAN on ۳/۱۳/۲۰۲۰ م..
//freopen(filename,read)
#include <iostream>
#include <algorithm>
#include <map>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <iterator>
#include <cmath>
#include <ctime>
#include <iomanip>
#define lint long long int
#define kill(x) return cout<<x<<'\n', 0;
#define debug(x) cout << #x << " : " << x << '\n'

using namespace std;
const int maxn = 1e6+7;
lint argc [maxn];
lint dp [maxn];
int n,cnt,ans,mini,x,t,z,f,y,se,p;
string s;
string sm[137];
string m[137];
int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    cin >> n >> s;
    m[0] =s[0];
    for(int i = 1;i <= n ;i++){

        sm[i-1] = m[i-1] + m[i-1];
        m[i]= m[i-1] + s[i];
    }
    for(int i = n;i>0;i--){
      // cout<<sm[i] <<"  "<<m[2*i]<<endl;
        if(sm[i-1] == m[2*i-1]){
          //  cout<<"akbar"<<endl;
            cnt = i;
            f = 1;
            break;
        }
    }
    cnt -= f;
  /*  for(int i = 0;i < n;i++){
        debug(i);
        debug(m[i]);
        debug(sm[i]);
    }
    */
    cout<<n-cnt<<endl;
}

#include<bits/stdc++.h>
#include<unordered_map>
typedef long long ll;
typedef long double ld;
using namespace std;
FILE *stream;
int n;
string s;
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	//freopen_s(&stream, "input.txt", "r", stdin);
	//freopen_s(&stream, "output.txt", "w", stdout);

	cin >> n >> s;
	int ind, ans = -1;
	for (int i = 1; i <= n / 2; i++) {
		if (s.substr(0, i) == s.substr(i, i))
			ans = max(ans, i);

	}
	if (ans == -1)cout << n;
	else cout << n - (ans)+1;

	return 0;
}

#include<iostream>
using namespace std;
int main()
{
	int n, max = 1;
	string s;
	cin>>n>>s;
	int br = 0, j;
	for(int i = 2;i<=n/2;i++)
	{
		br = 0;
		if(s[0] == s[i])
		{
			for(j = 0;j<i;j++)
			{
			if(i+j>=n)
			{
				br = 1;
				break;
			}
			if(s[j] == s[i+j])
				br++;
			else
			break;

			}

			if(j == i && max < br)
			max = br;
		}
	}
	cout<<n-max+1;
}

#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
char s[105];
int fail[105];
int main()
{
    int n;
    while(scanf("%d%s", &n, s) != EOF)
    {
        int res = n;
        char t1[105], t2[105];
        for(int i = n / 2; i > 1; i--){
            strcpy(t1, s);strcpy(t2, s + i);
            t1[i] = t2[i] = 0;
            if(strcmp(t1, t2) == 0){
            res -= i - 1;break;
            }
        }
        printf("%d\n", res);
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
char s[maxn];
int main() {
  int n;
  while (cin >> n) {
    cin >> s;
    int pos = n / 2;
    int ans = n;
    bool flag = false;
    while (!flag && pos > 0) {

      while (pos > 0 && s[pos] != s[0])
        pos--;
      if (pos == 0)
        break;
      else {
        int i;
        for (i = 0; i < pos; i++)
          if (s[i] != s[i + pos])
            break;
        if (i == pos) {
          flag = true;
          ans = ans - pos + 1;
        } else
          pos--;
      }
    }

    cout << ans << endl;
  }
  return 0;
}

#include<bits/stdc++.h>

using namespace std;

int n,ans;
string s;

main(){
    cin>>n>>s;

    ans=n;
    for(int i=1;i<=n/2;++i)if(s.substr(0,i)==s.substr(i,i))ans=i+1+n-i*2;
    cout<<ans;
}

#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define IO ios::sync_with_stdio(false);\
    cin.tie(0);\
    cout.tie(0);
const int maxn =107;
string str;
int main()
{
    IO;
    int n;
    cin>>n;
    cin>>str;
    int ans=0;
    for(int len=1;len<=n/2;len++)
    {
        if(str.substr(0,len)==str.substr(len,len))
        {
//            cout<<str.substr(0,len)<<" "<<str.substr(len,len)<<endl;
            ans=max(ans,len);
        }
    }
//    cout<<ans<<endl;
    if(ans==0)
        n--;
    cout<<n-ans+1<<endl;
    return 0;
}

#include <iostream>
#include<cstdlib>
#include<stdio.h>
#include<algorithm>
#include<set>
#include<vector>
#include<assert.h>
#include<string>
#include<string.h>
#include<algorithm>
using namespace std;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef long long ll;
const ll mod = 1000000007;
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }

const int maxn = 105;
int n;
char s[105];

int main(){
	scanf("%d%s", &n,s+1);
	int cnt = n;
	int mid;
	if(n % 2){
		mid = (n+1)/2;
	}else mid = n/2+1;
	per(i,2,mid){
		int flag = 1;
		rep(j,1,i-1){
			if(s[j]!=s[j+i-1]){
				flag = 0;
				break;
			}
		}
		if(flag){
			cnt = 1;
			cnt+=(n-i+1);
			break;
		}
	}
	printf("%d", cnt);

	return 0;
}

/* ****amitm16a2**** */

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define mp          make_pair
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	ll n;
	cin>>n;

	string s;
	cin>>s;

	//ll t=-1;
	ll maxm=0;
	ll count=0;
	ll i=0;

		for(ll j=1; j<n; j++){

			if(s[0]==s[j]){
				ll k=0;
				ll h=j;
				 count=0;
				 //cout<<"0"<<" "<<j<<endl;

				while(s[k]==s[h] && k<(n)/2 && h<n && k<j){
					k++;
					h++;
					count++;

				}
				//cout<<j<<" "<<count<<endl;

				if(j==count)
				maxm=max(maxm,count);

			}
		}

	//cout<<maxm<<endl;
	ll ans;

    if(maxm>1)
    ans=n-maxm+1;
    else
    	ans=n;

	cout<<ans;

	return 0;
}

#include<bits/stdc++.h>
#define NN 111
using namespace std;

using INT = long long;
using pii = pair<int, int>;

char str[NN];

int dp[NN];

bool check(int t){
	for(int i = 1; i <= t / 2; i++){
		if(str[i] != str[t / 2 + i]) return 0;
	}
	return 1;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	ios_base :: sync_with_stdio(0);cin.tie(0);
	int n;
	cin >> n;
	cin >> str + 1;
	int cnt = 0;
	int ans = 0;
	for(int i = n; i >= 1; i--){
		if(i % 2 == 0 && check(i)) {ans = n - i / 2 + 1; break;}
	}
	if(ans == 0) ans = n;
	cout << ans << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,n,j,k,c,ans;
    string s;
    cin>>n>>s;
    ans=n;
    n/=2;
    while(n>1){
    c=0;
    for(i=0;i<n;i++)
    {
        if(s[i]==s[i+n])
            c++;
    }
    if(c==n){
        ans=ans-n+1;
        n=1;
      }
     n--;
    }
    cout<<ans;
}

#include<iostream>
#include<cstdio>
#include<cstdlib>

using namespace std;

int main(){
    int len;
    char str[250] = {'0'};
    cin >> len;
    int res = 1;
    for(int i = 0;i < len;i ++){
        cin >> str[i];
    }
    for(int i = 1; i < len; i++){
        if(str[i] == str[0]){
            bool flag = true;
            for(int t = 1;t < i;t ++){
                if(str[i+t] != str[t]){
                    flag = false;
                    break;
                }
            }
            if(flag){
                res = i;
            }
        }
    }
    cout << len-res+1;
}

// code by - Sankalp Ranjan

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define ll long long int
#define tc    \
    ll t;     \
    cin >> t; \
    while (t--)
#define arip(a)                 \
    for (int i = 0; i < n; i++) \
        cin >> a[i];
#define print(a)                \
    for (int i = 0; i < n; i++) \
        cout << a[i] << " ";

#define f(i, a, b) for (ll i = a; i < b; i++)
#define fo(i, a, b, c) for (int i = a; i < b; i += c)
#define fr(i, a, b) for (int i = a; i >= b; i--)

#define pb push_back
#define pf push_front
#define popf pop_front
#define popb pop_back
#define mp make_pair

#define M 1000000007
#define PI 3.14159265
#define INF (ll)9e18

#define vll vector<ll>
#define vpll vector<pair<ll, ll>>
#define pll pair<ll, ll>

#define lcm(a, b) (a * b) / (__gcd(a, b))
#define swap(a, b) \
    a ^= b;        \
    b ^= a;        \
    a ^= b;
#define l_b(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define u_b(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define max3(a, b, c) max(a, max(b, c))
#define min3(a, b, c) min(a, min(b, c))
#define yes cout << "YES" << endl
#define no cout << "NO" << endl

template <typename T>
void read(T &x)
{
    cin >> x;
}
template <typename T, typename T0>
void read(T &x, T0 &y) { cin >> x >> y; }

template <typename T, typename T0, typename T1>
void read(T &x, T0 &y, T1 &z) { cin >> x >> y >> z; }

bool isPowerOfTwo(int x) { return x && (!(x & (x - 1))); }

int digits(int n)
{
    int x = floor(log10(n)) + 1;
    return x;
}

ll fact(ll n)
{
    if (n == 0)
        return 1;
    return n * fact(n - 1);
}

bool sortbysec(const pair<int, int> &a, const pair<int, int> &b)
{
    return (a.second < b.second);
}

vector<bool> sieve(1000000, true);
void sieve_er()
{
    sieve[0] = false;
    sieve[1] = false;
    for (ll i = 2; i * i <= 1000000; i++)
    {
        if (sieve[i] == true)
        {
            for (ll j = i * i; j < 1000000; j += i)
                sieve[j] = false;
        }
    }
}

vll vec;
void divisors(ll n)
{
    for (ll i = 1; i <= sqrt(n); i++)
    {
        if (n % i == 0)
        {

            if (n / i == i)
                vec.pb(i);
            else
            {
                vec.pb(i);
                vec.pb(n / i);
            }
        }
    }
}

ll total_divisors(ll n)
{
    ll c = 0;
    for (ll i = 1; i <= sqrt(n); i++)
    {
        if (n % i == 0)
        {
            if (n / i == i)
                c = c + 1;
            else
                c = c + 2;
        }
    }
    return c;
}

ll nCr(ll n, ll r)
{
    ll ans = 1;
    f(i, 0, r)
    {
        ans *= n - i;
        ans /= i + 1;
    }
    return ans;
}

ll power_m(ll a, ll b, ll m = M)
{
    a %= m;
    ll res = 1;
    while (b > 0)
    {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}

ll power(ll a, ll b)
{
    ll res = 1;
    while (b > 0)
    {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
ll strTo(string s)
{
    stringstream tmp(s);
    ll x = 0;
    tmp >> x;

    return x;
}

string NoTo(ll n)
{
    ostringstream str1;
    str1 << n;
    string ans = str1.str();
    return ans;
}

void start()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //  start();
    int n; string s; read(n,s);
    int ans=0;
    if(n<=3)ans=n;
    else
    {
        int c=0;
        for(int x=n/2;x>=2;x--)
        {
                string s1=s.substr(0,x);
                string s2=s.substr(x,x);
                if(s1==s2)
                {
                    // cout<<s1<<" "<<s2<<endl;
                    c=x;
                    break;
                }
            if(c!=0)break;
        }
        if(c==0)ans=n;
        else{
        ans=n-c+1;
        }
    }
    cout<<ans<<"\n";

    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
return 0;
}

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>

using namespace std;

#define FSIO  ios::sync_with_stdio(0);cin.tie(0);
#define DEBUG(a)   cout<<"DEBUG: "<<(a)<<endl;

const int MAXN = 1000005;
const int MOD = 1e9+7;
const int INF = 1e9+7;

int nextj[105];
string b;
    int n;

void get_next()
{
    int i, j;
    nextj[0]=-1;
    i=0; j=-1;
    while(i<n){
        if(j==-1||b[i]==b[j])    {++i; ++j; nextj[i]=j;}
        else    j = nextj[j];
    }
}

int dfs(int pos)
{
    while(nextj[pos]>0)
        pos = nextj[pos];
    return pos;
}

int main()
{
    FSIO;

    while(cin>>n>>b)
    {
        int maxn = 0;
        for(int i=1;i<b.length();++i)
        {
            if(b[i]==b[0])
            {
                int j=1;
                for(;j+i<b.length()&&j<i;++j)
                {
                    if(b[j]!=b[i+j])    break;
                }
                if(j==i)    maxn = max(maxn,j);
            }
        }
        if(maxn==0)    maxn=1;
        cout<<(n-maxn+1)<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/detail/standard_policies.hpp>
// using namespace __gnu_pbds;
using namespace std;
// template <typename T>
// using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
//     tree_order_statistics_node_update>;

typedef long long int ll;
const ll N = 1e6 +9;
const ll p = 31;
// const ll m = 1e9 + 7;
const ll inf= 1e14;
const ll mod = 1e9+7;
#define x first
#define y second
#define pb push_back
#define mp make_pair
using pii = pair<ll, ll>;
ll powm(ll a, ll b) { a = a%mod;ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; }

int main()
{
     ios::sync_with_stdio(false);
     cin.tie(0);
     cout.tie(0);
     #ifndef ONLINE_JUDGE
     freopen("input.txt", "r", stdin);
     freopen("output.txt", "w", stdout);
     #endif
     ll T= 1;
     // cin >> T;
     while(T--){
          ll n;cin>>n;
          string s;cin>>s;
          ll dp[n];
          dp[0] = 1;
          for(int i = 1;i<n;i++){
               dp[i] = inf;
          }
          ll ma = 0;
          for(int i = 1;i<n;i++){
               if(i%2){
                    ll len = i/2;len++;
                    // cout<<i<<'\n';
                    // cout<<s.substr(0,len)<<" "<<s.substr(len,len)<<'\n';
                    if(s.substr(0,len)==s.substr(len,len)){
                         ma = max(len-1,ma);
                    }
               }
          }
          // cout<<ma<<'\n';
          cout<<n-ma<<'\n';
     }
}

#include <iostream>
#include <string>
using namespace std;
int n,i,k;
string str;
int main ()
{
	cin>>n>>str;
for (i=1; i<=n/2; i++)
if (str.substr(0,i)==str.substr(i,i)) k=i-1;

	cout<<n-k<<endl;
	return 0;
}

/// Go away
/// Thanks
#include <bits/stdc++.h>

#define mp(a,b) make_pair(a,b)
#define fast cin.tie(0);cout.tie(0);std::ios_base::sync_with_stdio(0);
#define fuf -1;
#define YES cout << "Yes\n";return(0);
#define NO cout << "No\n";return(0);
#define HEY cout << "HEY\n";return(0);
#define min3(a,b,c) min(min(a,b),c)
#define max3(a,b,c) max(max(a,b),c)
#define mid3(a,b,c) a+b+c-max3(a,b,c)-min3(a,b,c)
#define nullptr NULL
#define int long long

const double EPS = 0.0000000001;
const int mod1 = 998244353;
const int mod2 = 1000000007;
const int mod3 = 1000000009;
const int mod4 = 998244353;
const int inf = 100000000000000;
using namespace std;

signed main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    int cnt = s.size();
    for(int i = 1;i<n;i ++){
        bool p = 0;
        for(int z = 0;z<i;z++){
            if(s[z] != s[i+z]){
                p = 1;
            }
        }
        if(p) continue;
        cnt = min(cnt,i+1+(s.size()-2*i));
    }
    cout << cnt;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
 	ios::sync_with_stdio(false);
 	cin.tie(0);
 	int n;
 	cin >> n;
 	char str[110];
 	cin >> str;
 	int i, first = -1, ans = n, final = 200;
 	for(i=1;i<n;i++){
 	 	if(str[0]==str[i]){
 	 	  first = i;
 	 	 	bool flag1 = false;
 	 		int j,k;
 	 		for(k=0,j=first;k<first;k++,j++){
 	 	 		if(str[k]!=str[j]){
 	 	 	 		flag1 = true;
 	 	 	 		break;
 	 	 		}
 	 		}
 	 		if(!flag1){
 	 	 		if(ans-first+1<final)
 	 	 			final = ans-first+1;
 	 	 	}
 	 		else{
 	 	 		if(final > ans)
 	 	 			final = ans;
 	 	  }
 	 	}
 	}
 	if(first==-1){
 	 	cout << ans;
 	}
 	else{
 	 	cout << final;
 	}
 	return 0;
}

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<list>
#include<set>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef long double ld;
#define mem(x) memset(x, 0, sizeof(x))
#define me(x) memset(x, -1, sizeof(x))
#define fo(i,n) for(i=0; i<n; i++)
#define sc(x) scanf("%lld", &x)
#define sca(n,m) scanf("%lld%lld", &n, &m)
#define pr(x) printf("%I64d\n", x)
#define pri(x) printf("%lld ", x)
#define lowbit(x) x&-x
const ll MOD = 1e9 +7;
const ll oo = 0x3f3f3f3f;
const ll N = 3e6 +5;

int main()
{
    ll i, j, k, l=0;
    ll n, m, t;
    cin>>n;
    string a;
    cin>>a;
    ll mi=n, f=0;
    for(i=1; i<n; i++)
    {
        l=i+1;
        //for(j=0; j<i, l<n; j++)
        j=0;
        {
            f=0;
            if(a[j]==a[l])
            {
                for(k=j+1, t=l+1; k<=i; k++, t++)
                {
                    if(a[k]!=a[t])
                    {
                        f=1;break;
                    }
                }
                if(!f)
                {
                    mi=min(n-(i-j+1)+1, mi);
                    //cout<<mi<<"   "<<i<<endl;
                }
            }

        }
    }
    cout<<mi<<endl;
    return 0;
}

#include <vector>
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
using namespace std;
long long mx[100000], p=0;
bool f=0;
int main()
{
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout)
    int n, m, col=0;
    cin >> n;
    string s;
    cin >> s;
    for (int i=1; i<=n/2; ++i){
        if (s.substr(0, i)==s.substr(i, i)){
            mx[p]=i;
            p++;
            f=1;
        }
    }
    int MX=-1e9;
    if (f){
        for (int i=0; i<p; ++i){
            if (MX<mx[i]) MX=mx[i];
        }
        cout << n-MX+1 << endl;
    }
    else cout << n << endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,m=0;

    string s;

    cin>>n>>s;

    for(int i=1; i<=n; i++)
    {
        if(s.substr(0,i)==s.substr(i,i))
       {
           m = i-1;

       }
    }

    cout<< n - m <<endl;

    return 0;
}

#include<iostream>
#include<algorithm>
#include<iomanip>
#include<string>
#include<vector>
#include<cmath>
#include<set>
#include<map>
using namespace std;
int sizes = -1;
int main() {
	string str;
	string W = "";
	bool T = 0;
	int n;
	cin >> n >> str;

	for (int i = 0; i < str.size(); i++) {
			W += str[i];
		if(W.size() == str.find(W, W.size())){
			sizes = W.size(); T = 1;
		}
	}
	if(T)
	cout << n - sizes +1  << "\n";
	else cout << n << "\n";
	return 0;
}

#include<bits/stdc++.h>
 using namespace std;
 int main(){
 string str;
    long long k;
    cin>>k>>str;
    for(long long i=0;i<k/2-1;i++)
    {
        string qt="",wt="";
        for(long long j=0;j<k/2-i;j++)
        {
            qt+=str[j];
        }
        for(long long j=0;j<k/2-i;j++)
        {
            wt+=str[j+k/2-i];
        }
        if(qt==wt)
        {
            long long b=qt.size();
            cout<<k-b+1;
            return 0;
        }
    }
    cout<<k;
 }

/*
 * @author : Kaustuk Rathod
 */
#include <bits/stdc++.h>
#define F first
#define S second
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define fast_cin() ios_base::sync_with_stdio(0)
const int mod = 1e9+7;
using namespace std;

int main()
{
    fast_cin();
    int N, i, j, k;
    char in[105];
	scanf("%d", &N);
	scanf("%s", in + 1);
/*	for(ll i=1;i<=N;i++)
		cout<<in[i];*/
	int mx = 1;
	for (i = 1; i <= N / 2; i++) {
		for (j = 1; j <= i; j++) if (in[j] != in[j + i]) break;
		if (j > i) mx = max(mx, i);
	}
	return !printf("%d\n", N - mx + 1);
}

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ff first
#define ss second
#define eb emplace_back
#define MP make_pair
#define pb push_back
#define pf push_front
#define ins insert
#define endl '\n'
#define all(v) (v).begin(), (v).end()
#define mset(m,v) memset(m,v,sizeof(m))
#define tr(c,it) for(auto it=c.begin();it!=c.end();it++)
#define fr(i,n) for(lli i=0;i<(n);i++)
#define inc(i,a,b) for(lli i=a;i<=b;i++)
#define dec(i,a,b) for(lli i=a;i>=b;i--)
#define fr2(i,n) for(int i=0;i<(n);i++)
#define inc2(i,a,b) for(int i=a;i<=b;i++)
#define dec2(i,a,b) for(int i=a;i>=b;i--)
#define ymin(a,b)  (a=min((a),(b)))
#define ymax(a,b)  (a=max((a),(b)))
#define sz(x) (lli)(x).size()
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr<< *it << " = " << a << endl;
	err(++it, args...);
}

typedef long long int lli;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<lli,lli> plli;
typedef vector<lli> vlli;
typedef vector<int> vi;
//typedef  vector<vector<lli> >ncr(1001,vector<lli>(1001,0))
typedef vector<plli> vplli;
long long MOD=1000000009;
#define addm(x,y) (x+y>=MOD? (x+y-MOD):(x+y))
void solve()
{
	int n;
	cin>>n;
	char ch[n+1];
	set<char>s;
	//map<int,int>mp;
	for(int i=0;i<n;i++)
	{
		cin>>ch[i];
		//mp[((int )ch[i]-97)%26]++;
		s.insert(ch[i]);

	}
	if(n==1)
	{
		cout<<1;
		return;
	}
	if(sz(s)==1)
	{
		if(n%2==1)
		{
			cout<<(n/2)+2;
			return;
		}
		else
		{
			cout<<(n/2)+1;
			return;
		}
	}
	else if(s.size()==n)
	{
		cout<<n;
		return ;

	}
	else
	{
		int st1,st2;
		for(int len=n/2;len>=1;len--)
		{
			int f=1;
			for(int i=0;i<=n-2*len;i++)
			{

				for(int j=0;j<len;j++)
				{
				if(ch[i+j]==ch[i+len+j])
				{
					continue;
				}
				else
				{
					f=0;
					break;
				}
				}
				if(f==1)
				{
				// 	int ans=len+1;
				// 	if(i>0)
				// 	st1=i-1;
				// else
				// 	st1=i;
				// 	 st2=2*len+i;
				// 	ans+=st1+n-st2;
					int ans=1+i+n-len;
					cout<<min(n,ans);
					return;

				}

			}

		}
		cout<<n;

	}
}
int main()
{
		#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	IOS
	// clock_t start,end;
	// start=clock();
	// int t;
	// cin>>t;
	// for(int i=1;i<=t;i++)
	// {
	// 	cout<<"Case #"<<i<<": ";
	// 	solve();

	// }

	// end=clock();

	// double time_taken=double(end-start)/double(CLOCKS_PER_SEC);
	// cout<<fixed<<setprecision(10)<<time_taken<<" sec"<<endl;

	solve();
}

#include <bits/stdc++.h>
using namespace std;

#define eps 0.00000001
#define MOD 1000000007
#define pi ( 2*acos(0.0) )
#define factor 1.000000011
#define here cout << "here\n"

void dbg() {}
template<typename T, typename ... Types> void dbg(T var1, Types ... args) { cout << var1 << " "; dbg(args...); }

typedef long long ll;

inline ll d2L(double d)
{
    if( ceil(d)-d < eps ) return (ll) ceil(d);
    else return (ll) d;
}

/// $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ Template $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $

int main()
{
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    // freopen("input.txt", "r", stdin);
    int n;
    string str;
    cin >> n >> str;
    int maximum = 0;
    for( int j=1; j<=n-1; j++ )
    {
        if( str[j]==str[0] )
        {
            int length = 1;
            int a = 1, b = j+1;
            while( a<j && a<=n-1 && b<=n-1  )
            {
                if( str[a]==str[b] )
                {
                    length++;
                    a++; b++;
                }
                else break;
            }
            if( a==j )
            {
                maximum = max(length, maximum);
            }
        }
    }
    if(maximum>0) cout << n-maximum+1;
    else cout << n;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
string s;
int n,ans;

int main()
{
	cin>>n>>s;
	ans=n;
	for(int i=n/2;i>=1;i--)
	{
		if(s.substr(0,i)==s.substr(i,i))
		{
			ans-=i-1;
			break;
		}
	}
	cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >>n;
	string s;
	cin >>s;
	int ans=n;
	int haha=1;
	for(int i=2;i<=n/2;i++){
		bool ok=true;

			string x= s.substr(0,i);
		/*	cout <<x<<endl;*/
			int k =i;
				/*cout <<k <<endl;*/
				if(s.substr(k,i)==x){
				/*	cout << k<<endl;*/

					haha=max(i,haha);
				/*	break;*/
				}

		/*	if(!ok) break;*/

       /* cout <<endl;*/
 	}

cout <<ans-(haha-1)<<endl;
}

#include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

string s;

int main(){
    int n,length;

    while(cin>>n){
        cin>>s;

        length = n;
        for(int i=0;i<n;i++){
            if(s.substr(0,i+1)==s.substr(i+1,i+1)){
                length = min(n-i,length);
            }
        }
        cout<<length<<endl;
    }

    return 0;
}

//move on rick
#include<bits/stdc++.h>
using namespace std;
#define    ll    long long int
ll m,n,c,d,j,k,l,r,x,t,y,u,b,z,i,e,f,g,h;
int main ()
{
string s;c=1;
cin>>n>>s;
	for(i=1;i<=n;i++){

	if(s.substr(0,i)==s.substr(i,i))
	c=i;
	}
	cout<<n-c+1;
}

#include<iostream>
#include<cstdio>
#include<cstdlib>

using namespace std;

int main(){
    int len;
    char str[250] = {'0'};
    cin >> len;
    int res = 1;
    for(int i = 0;i < len;i ++){
        cin >> str[i];
    }
    for(int i = 1; i < len; i++){
        if(str[i] == str[0]){
            bool flag = true;
            for(int t = 1;t < i;t ++){
                if(str[i+t] != str[t]){
                    flag = false;
                    break;
                }
            }
            if(flag){
                res = i;
            }
        }
    }
    cout << len-res+1;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    string s;
    cin >> n >> s;
    int ans = n;
    for(int i = 1 ; i <= n/2 ; i++)
    {
        if(s.substr(0,i) == s.substr(i,i))
            ans = n - i + 1 ;
    }
    cout << ans << endl;

    return 0;
}

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <sstream>
#include <cstdio>
#include <string>
#include <fstream>
#include <vector>
#include <map>
#include <algorithm>
#include <set>

using namespace std;

int main() {
	//ifstream cin("in.txt");
	//ofstream cout("out.txt");
	int n, ans = 0;
	string s;
	cin >> n;
	cin >> s;
	for (int i = 2; i <= n; i += 2) {
		string s1, s2;
		s1 = s.substr(0, i / 2);
		s2 = s.substr(i / 2, i / 2);
		if (s1 == s2) {
			ans = i / 2 - 1;
		}
	}
	cout << n - ans;
	return 0;
}

#include <bits/stdc++.h> // gcc or clang only
using namespace std;

int main()
{
    int n;
    string s;
    cin >> n >> s;
    int ans = n;
    for (int i=0; i<n; i++)
        if (s.substr(0,i) == s.substr(i,i))
            ans = min(ans, n-i+1);
    cout << ans << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,op=1,lim;
    scanf("%d",&n);
    char st[n+1];
    cin>>st;
    lim=n/2;
    for(int i=lim;i>0;i--){
        int ii=0,flg=0;
        for(int j=i;ii<i;j++){
            if(st[ii]==st[j])ii++;
            else {break;}
        }
        if(i==ii){
            op=i+1+(n-(i*2));break;
        }
        else if(i==1){
            op=n;
        }
    }
    cout<<op<<endl;
    return 0;
}

#include <bits/stdc++.h>
#include <cstring>
#define ll long long int
using namespace std;
int main()
{
    ll t,a,b,c,d,i,j,k,l,n,m,x,y;
     string s;
     cin>>n;
     cin>>s;

     k=0;
     l=0;
     for(i=0;i<n;i++){
       l=0;
       for(j=i+1;j<n;j++){
            if(s[j]==s[l]){
             l++;

                if(l>i){
                k=max(k,l);
                break;
            }
       }
            else{

              break;
}
      }
}
      a=(n-k)+1;

      if(k==0)
       a=a-1;
      cout<<a;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define MOD 1000000007
vector<int> prefix_function(string s) {
    int n = (int)s.length();
    vector<int> pi(n);
    for (int i = 1; i < n; i++) {
        int j = pi[i-1];
        while (j > 0 && s[i] != s[j])
            j = pi[j-1];
        if (s[i] == s[j])
            j++;
        pi[i] = j;
    }
    return pi;
}
int main()
{
	int n;
	cin >> n;
	string str;
	cin >> str;

	ll i,count=0;
	for (i=0;i<n;i++){
		ll k = 0;
		while (k != i+1 && k+i+1 < n){
			if (str[k] != str[i+k+1]){
				break;
			}
			k++;
		}
		if (k == i + 1 && k + i < n){
			count = i;
		}
	}
	count++;
	ll ans = count + 1 + str.length() - 2*count;
	cout << ans << endl;
}

#include<bits/stdc++.h>
using namespace std;
int n;
string s;
int main()
{
	cin>>n>>s;
	for(int i=n/2;i>0;i--)
		if(s.substr(0,i)==s.substr(i,i))
		{
			cout<<n-i+1;
			return 0;
		}
	cout << n;
	return 0;
}

/*
ID: gulatit1
LANG: C++14
TASK:
*/
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define DEBUG_V(X) {cout << #X << " = {";  FOR(z,(X.size()-1)) { cout << (X[z]) << ", ";} cout << X[X.size()-1] <<"}" << endl;}
#define DEBUG_VP(X) {cout << #X << " = {"; FOR(z,(X.size()-1)) { cout << "(" << (X[z].first) << ", " << (X[z].second) << ")" << ", ";} cout << "(" << (X[X.size()-1].first) << ", " << (X[X.size()-1].second) << ")" <<"}" << endl;}
#define SQ(X) (X)*(X)
#define EQ(X,Y) (abs((X)-(Y)) <= 1e-8)
#define CI(I,LEN) ((((I)%(LEN))+(LEN))%(LEN))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
vector<int> fillvec(int size){vector<int> ans;for(int i = 0; i < size; i++){int temp; cin >> temp; ans.push_back(temp);}return ans;}
int gcd(int a,int b) {return !a ? b : gcd(b%a,a);}
vector<ll> getdivisors(ll n){vector<ll> ans;for(ll i=1; i<=sqrt(n); i++){if (n%i == 0){if (n/i == i){ans.push_back(i);}else {ans.push_back(i); ans.push_back(n/i);}}} sort(ans.begin(),ans.end()); return ans;}
string DecToBin(int number){if ( number == 0 ) return "0";if ( number == 1 ) return "1";if ( number % 2 == 0 )return DecToBin(number / 2) + "0";else return DecToBin(number / 2) + "1";}

int main(){
  //ifstream fin("problem.in");
  //ofstream fout("problem.out");
  ios::sync_with_stdio(0); cin.tie(0);
  int n; string s; cin >> n >> s;
  int ml = 0;
  //maximize the length of the thing you need to copy and paste
  for(int i = 1; i <= (n/2); i++){
    string ss = s.substr(0,2 * i);
    //DEBUG(ss)
    if(ss.substr(0,ss.size()/2) == ss.substr(ss.size()/2)){
      //DEBUG(i)
      ml = max(ml,i);
    }
  }
  //DEBUG(ml)
  cout << min(n,(n-ml+1)) << endl;
  //fin.close();
  //fout.close();
}

#include<bits/stdc++.h>

using namespace std;
 int n;
    string s;
int main()
{

    cin>>n>>s;
    int k=n;
    for(int i=1;i<=n/2;i++)
    if(s.substr(0,i)==s.substr(i,i)){
            k=n-i+1;
    }
    cout<<k<<endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define NN 111
char s[NN];

int ok(int st, int ed) {
	int mid = st + ed >> 1;
	int len = (ed - st + 1) >> 1;
	for(int i=st;  i<=mid; i++) if(s[i] != s[i + len]) return 0;
	return 1;
}

int main () {
#ifndef ONLINE_JUDGE
    freopen("in.in", "r", stdin);
    freopen("out.out","w",stdout);
#endif
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n;
	cin >> n;
	cin >> s + 1;
	int ans = n;
	for(int i=n; i; i--) {
		if(ok(1, i)) {
			int len = i;
			ans = min(ans, (len + 1) / 2 + 1 + n - i);
		}
	}

	cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std ;

#define faster_io ios_base::sync_with_stdio(false);cin.tie()
#define getmin(a,b)  ( (a) < (b) ? (a) : (b))
#define getmax(a,b)  ( (a) > (b) ? (a) : (b))
#define all(v) v.begin() , v.end()
#define ull unsigned long long
#define ll long long
#define PI 3.141592653589793
#define SIZE 100000
#define MX 40010
#define F first
#define S second
#define pb(a) push_back((a))
#define mp(a,b) make_pair((a),(b))
#define elif else if
#define MAX 500000
#define forr(a,b) for( int i=(a) ; i < (b); i++)
ll power (ll x, ll y)
{
    if (y==0) return 1 ;
    ll temp=power(x,y/2) ;
    if (y%2==0) return temp*temp ;
    else return x*temp*temp ;
}

bool isprime (ll a)
{
    if (a==1) return false ;
    if (a==2) return true ;
    if (a%2==0) return false;
    for (ll i=3; i*i<=a ; i+=2)
    {
        if (a%i==0) return false;
    }

    return true ;
}

ll gcd (ll a,ll b)
{

    if(a==0)
        return b ;
    else return gcd (b%a, a) ;

}

ll lcm (ll a, ll b)
{

    return ((a/gcd(a,b))*b) ;

}

int charToInt (char c)
{   if (int(c)>=48&& int(c)<=57)
    return int(c)-48 ;
    else return -1 ;

}
char intToChar(int r)
{

    return char(48+r) ;
}

int stringToInt (string s) {
ll a=0 ;
for (int i=0 ; i<s.length() ; i++) {
    a=a*10+(charToInt(s[i])) ;}
    return a ;

}

string intToString (int n) {

string s="" ;
if (n==0 ) {
    return "0" ;
}
ll temp ;
while(n) {
    temp=n%10 ;
    n/=10 ;
    s+=intToChar(temp) ;

}

reverse(all(s)) ;
return s ;
}

/*

void print_vector (vector <auto> v) {
cout<<endl ;
for (int i=0 ; i<v.size() ; i++) {
    cout<<v[i]<<" ";
}
cout<<endl ;

}
*/

vector < bool > sieve (MAX+1, true) ;
vector <ll> primes;

void c_sieve(ll n)
{

    sieve[0]=sieve[1]=false ;
    // cout<<sieve[3] <<endl ;
    for (ll i =3 ; i*i<=n ; i+=2)
    {

        if (sieve[i])
        {
            for (ll j= i*i ; j<=n ; j+=2*i)
            {
                sieve[j]=false ;

            }
        }

    }

}

void c_primes(ll n)
{
    primes.pb(2) ;
    for ( ll i =3 ; i<=n ; i+=2)
    {
        if (sieve[i]) primes.pb(i) ;
    }
}

 ll lcs (string s , string e , int s_n , int e_n) {

 if (e_n==0 || s_n ==0) {
    return 0 ;
 }
 if (s[s_n-1]==e[e_n-1]) return 1+ lcs(s,e ,s_n-1  , e_n-1) ;
  else return  max  (  lcs(s,e,s_n-1,e_n) ,lcs(s,e,s_n,e_n-1) ) ;

 }
 bool is (ll k) {
  ll z,x ;
 while(k!=0 &&k>=10) {
    z=k%10 ;
    x=k/10%10 ;
    if(x==1&&z==3){
        return 0 ;
    }
    k/=10 ;
 }
 return true ;

 }

ll binarySearch (vector <ll> v , ll l , ll r , ll x ) {
    if (r>=l) {
        ll mid =l +(r-l)/2 ;
         if (v[mid]==x) return 1 ;
          if (v[mid]>x)  return binarySearch (v , l , mid-1 , x) ;
            return binarySearch(v,mid+1, r, x) ;
    }
return -1 ;
}

ll fact (ll n) {
    if (n==0)return 1 ;
    ll multi=1 ;
    for (ll i =2; i<=n ; i++) {multi*=i ;}
    return multi ;
    }
ll roma (char c) {
if (c=='I') return 1 ;
    else if (c=='V' )return 5 ;
    else if (c=='X' )return 10 ;

    else if (c=='L' )return 50 ;

    else if (c=='M' )return 1000 ;
    else if (c=='D' )return 500 ;

    else if (c=='C' )return 100 ;
    }
   ll func( ll a) {

    ll say=1 ;
    ll n=a ;
    ll m ;
    m=int(sqrt(n)) ;
    if ((n+m)%2==0) n=n+m ;
    else n=n-m ;
    while(n!=a) {
    m=int(sqrt(n)) ;
    if ((n+m)%2==0) n=n+m ;
    else n=n-m ;
    say++ ;

    }
     return say ;

   }

   bool sorta (pair<ll , ll > left  , pair <ll , ll > right) {
   if (left.S==right.S) {
    return left.F>right.F;
    }
   return left.S>right.S ;

   }

int main()
{
    //faster_io;
    //freopen ("input.txt", "r", stdin) ;
    //freopen("output.txt" ,"w" , stdout) ;
    int n ;
    cin>>n ;
     string s;
     cin>>s;
     if (n<4) {
        cout<<n ;
        return 0 ;
     }
     ll mina=1 ;
     for (int i =2 ; i <=n/2 ; i++) {
            string l=""  , r="";
            for (int j =0 ; j<i ; j++) {
                l+=s[j] ;
            }
            for (int j=i ; j<2*i ; j++) r+=s[j] ;
            if (l==r) {
               mina=i ;
            }
     }

        //cout<<mina<<"--------"<<endl  ;
        cout<<n-mina+1 ;
         //   cout<<"blabla";

            return 0;
}

#include<iostream>
using namespace std;

int main()
{
    int n;
    char ch[105];
    cin>>n;
    cin>>ch;
    int i,j;
    int flag = 0;
    for(j=n/2;j>=0;j--)
    {
        for(i=0;i<j;i++)
        {
            if(ch[i]!=ch[i+j])
            {
                flag = 0;
                break;
            }
            else
                flag = 1;
        }
        if(flag==1)
        {
            cout<<n-j+1<<endl;
            return 0;
        }
    }
    cout<<n<<endl;
}

#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define ull unsigned long long int
#define Max 1000005
#define _fastio  ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ALL(x) x.begin(),x.end()
#define pi acos(-1.0)
#define pb push_back
#define load(array,size)  for(ll i=0 ; i<size ; i++) cin>>array[i] ;
#define endl '\n'

#define sc(n) scanf("%d",&n)
#define scan(n) scanf("%lld",&n)
/*        speed up       */
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define sci(n) scanf("%d",&n);
#define scl(n) scanf("%lld",&n);
#define load1(array,size)  for(ll i=1 ; i<=size ; i++) cin>>array[i] ;
#define INF    1LL<<19
#define pll pair<ll,ll>
#define mst(arr,value) memset(arr,value,sizeof(arr));
#define tst() _fastio;int testsalam;cin >> testsalam;while(testsalam--)
#define Mod 100000007
#define YES cout<<"Yes"<<endl;
#define NO cout<<"No"<<endl;

//void inversemod(ll n, ll mod, ll invmod[],ll MOD){for(int i=2; i<=n; ++i) invmod[i]=MOD-MOD/i*invmod[MOD%i]%MOD;}
//void bigmod( ll a, ll b ,ll mod){ll r = 1;a = a%mod;while(b){if( b%2 ) r = (r*a)%mod;b = b/2;a = (a*a)%mod; }return (ll)r;}
string inttostr(ll n){std::stringstream ss;ss << n;string out=ss.str();return out;}
ll stringtoint(string s){istringstream iss (s);ll n;iss >> n;return n;}
template <typename T> T gcd(T a,T b){if(a < 0)return gcd(-a,b);if(b < 0)return gcd(a,-b);return (b == 0)?a:gcd(b,a%b);}
template <typename T> T lcm(T a,T b) {if(a < 0)return lcm(-a,b);if(b < 0)return lcm(a,-b);return a*(b/gcd(a,b));}
typedef vector<ll>vec;
typedef pair<ll,ll> pii;
typedef map<ll,ll>mpll;
typedef set<ll>seet;
typedef tuple<ll,ll,ll>tpl;

int main()
{
    int n,ans=0;
    string s,ch="";
    cin >> n>> s;
    for (int i = 0; i < n; ++i)
    {
        ch+=s[i];
        size_t f=s.find(ch);
        size_t ff=s.find(ch,i+1);
        // cout<<ch<<' '<<f<<' '<<ff<<endl;
        if(f!=string::npos and f==0 and ff==i+1)
            ans=i;

    }
    cout<<n-ans<<endl;
}
/*
     remember:
     ll vs int
     array size
     case for 1 2 3
*/

#include <iostream>

char s[101];

bool matched(int j)
{
    for (int i = 0; i < j; ++i)
        if (s[i] != s[i + j])
            return false;
    return true;
}

int main()
{
    int n;
    scanf("%d%s", &n, s);

    int j;
    for (j = n / 2; j > 1; --j)
        if (matched(j))
            break;

    int ans = (j == 0) ? n : n - j + 1;
    printf("%d\n", ans);

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pii pair<int,int>
#define pll pair<lli, lli>
#define vi  vector<int>
#define vii vector<pair<int,int>>
#define vll vector<lli>
#define pb  push_back
#define mpr  make_pair
#define ss  second
#define ff first
#define INF 1000000001
#define inf1 1000000000000000001
#define pie 3.14159265358979323846264338327950L
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define testcase() int tc;cin>>tc;while(tc--)
#define clean(x) memset(x,0,sizeof(x))
const lli maxn = 300000+5;
const lli mod= 1000000007;
vector<lli> catlan(int n) {
    vector<lli> dp(n + 1, 0);
    dp[0] = 1;
    dp[1] = 1;
    for (int i = 2; i <= n; i ++) {
        for (int j = 0; j < i; ++ j) {
            dp[i] += dp[j] * dp[i - j - 1];
        }
    }
    return dp;
}
lli digit(lli n){int res=(int)log10(n)+1;return res;}
lli lcm(lli a,lli b){lli ans=(a*b)/(__gcd(a,b));return ans;}
lli b_ex(lli n,lli a){lli res=1;while(n){if(n%2==1)res*=a;n>>=1;a=a*a;}return res;}
lli ncr(lli n,lli k){lli ans=1;if(k>n-k)k=n-k;for(lli i=1;i<=k;i++){ans*=(n-i+1),ans=ans/i;}return ans;}
lli power(lli a , lli n){lli ans = 1;while(n){if(n % 2)ans = (ans * a) % mod;n /= 2;a = (a * a) % mod;}return ans;}
lli set_bits(lli n)
{
    int c=0;
    if(n==0)return 0;
    while(n)
    {
        if((n&1)==1)
        {
           cout<<c<<" ";
        }
        c++;
        n=n>>1;
    }
    return c;
}

lli inf = 5e17;
///=================== ALWAYS CHECK 1 or 0 base case=================================================================================///
///------------------ALWAYS lli-----TEMP TSF99--------------------------------------------------------------------------------------//

void solve()
{
    int n;cin>>n;
    string a;cin>>a;
    int d=0;
    int ans=INT_MAX;
    for(int i=0;i<n;i++)
    {
        int st=0,ed=i+1;
        int j=i+1;
        int d=0;
        while(st<ed and st<n and j<n)
        {
            if(a[st]!=a[j])break;
            d++;
            st++,j++;
        }
        if(d==0 or d!=i+1)continue;
        ans=min(ans,n-2*d+d+1);

    }
    if(ans==INT_MAX)ans=n;
    cout<<ans<<endl;

}
int main()
{
    solve();
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int f=0;

    int n,cnt=0;
    string s;
    cin>>n>>s;
    int l=s.size();
    bool d=true;
    for(int i=0;i<n-1;i++){
        if(s[i]!=s[i+1]) {d=false;  break;}
            }
     if(n==1){ cout<<1; return 0;}
    if(d){
        cnt=n/2;
        cnt+=n%2;
        cout<<cnt+1;
        return 0;
    }
    int mx=0;
    for(int i=1;i<n;i++){

            for(int j=i;j<n;j++){

                    if(s.substr(0,j)==s.substr(j,j)){
                     mx=max(mx,j);
                    }

            }

    }if(mx>1){ l=(l-mx)+1;}
     cout<<l;
    return 0;
}

#include <bits/stdc++.h>

#define For(i,x,n)  for(long long i=x;i<n;i++)
#define MOD 1000000007
#define PI 3.141592653589793
#define INF 999999999999999999
#define N 1000005
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sp " "
#define cont continue
#define brk break

#define deb1(x)                cout<<#x<<": "<<x<<endl
#define deb2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define deb3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define deb4(a, b, c, d)       cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define deb5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define deb6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

using namespace std;

void setprime(bool isprime[],ll n);
ll choose(ll n,ll k);
void showArray(ll a[], ll n);
ll gcd(ll a, ll b);
ld len(ld x1, ld y1, ld x2, ld y2);
ld gcd_ld(ld x, ld y);
ll power(ll x, ll n);
ll power1(ll x,ll n);
#define MAXN (ll)2e5+5
#define mm(a) memset(a,0,sizeof(a));
ll visited[MAXN];

set<ll> facts;
void factor(ll n){
    ll i=2;
    while(i*i<=n){
        if(n%i==0)
            facts.insert(i);
        while(n%i==0)
            n /= i;
        if(i==2)
            i++;
        else i+=2;
    }
}

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed;
    cout<<setprecision(3);

    ll n;
    cin>>n;
    string s;
    cin>>s;
    ll ans=1;
    For(i,2,n/2+1)
        if(s.substr(0,i)==s.substr(i,i))
            ans = i;
    cout<<n-ans+1;
    // cout<<"\nTime used = "<<static_cast<double>(clock())/(CLOCKS_PER_SEC)<<"s"<<endl;  // - for checking time used for a test case
    return 0;
}

//s1.substr(1,3) - return 3 characters starting from position 1 as substring of string sz1. eg sz1="shreynumh" sz1.substr(2,5)="reyan"
//num = atoi(s.c_str()); //convert string s to integer num
//n.erase(i,std::string::npos); //erase i th position in string n , decreasing string size
//s.find(b)!= std::string::npos - finds string b in string a - true if found
//cout<<"Time used = "<<static_cast<double>(clock())/(CLOCKS_PER_SEC)<<"s"<<endl;  // - for checking time used for a test case

void setprime(bool isprime[],ll n)
{
    For(i,0,n)
    isprime[i]=true;

    isprime[0]=false;
    isprime[1]=false;

    For(i,2,n)
    {
        for(ll j=2;i*j<n;j++)
        isprime[i*j]=false;
    }
}

ll choose(ll n,ll k)
{
    if(k==0)  return 1;
    return (n* choose(n-1,k-1))/k;
}

void showArray(ll a[], ll n){
    For(i,0,n){
        cout<<a[i]<<" ";
    }
    cout<<endl;
}

ll gcd(ll a, ll b)
{
    if(b==0)
        return a;
    return gcd(b,a%b);
}

ld len(ld x1, ld y1, ld x2, ld y2){
    return sqrt(pow((x1-x2),2)+pow((y1-y2),2));
}

ld gcd_ld(ld x, ld y) {
    ld eps=0.0001;
    while (fabs(x) > eps && fabs(y) > eps) {
        if (x > y)
                x -= floor(x / y) * y;
        else
                y -= floor(y / x) * x;
    }
    return x + y;
}

ll power(ll x,ll n)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return (power((x*x)%MOD,n/2))%MOD;
    else                             //n is bal
        return (x*power((x*x)%MOD,(n-1)/2))%MOD;
}

ll power1(ll x,ll n)
{
    ll num = 1;
    For(i,0,n){
        num = (num*x)%MOD;
    }
    return num;
}

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	int n;
	string s;
	cin >> n >> s;

	int ans = n;
	for (int i = 1; i <= n/2; i++)
	{
		bool ok = 1;

		for (int j = i+1; j <= 2*i; j++)
			if (s[j-i-1] != s[j-1]) ok = 0;

		if (ok) ans = min(ans, n+1-i);
	}

	cout << ans << "\n";
}

#include <bits/stdc++.h>
// #include "prettyprint.hpp"
using namespace std;

typedef long long int lli;
#define int lli

typedef pair<int, int> pii;
typedef vector<int> vi;

#define debug(x) cout << "debug: " << #x " = " << x << endl
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(x) x.begin(), x.end()

int32_t main(){
	fast_io();

	int n; cin >> n;
	string s; cin >> s;

	int maxl = 0;

	if (n==1) {
		cout << 1 << endl; return 0;
	}

	for (int l = 0; l <= s.size()/2; ++l) {
		// debug(l);
		// debug(s.substr(0,l));
		// debug(s.substr(l,l));
		if (s.substr(0,l) == s.substr(l,l))
			maxl = l;
	}

	if(maxl == 0)
		cout << s.size() << endl;
	else
		cout << maxl+1+s.size()-2*maxl << endl;

}

/********************************************************
 *    #####   #    #    ##     ####    #   #    ##      *
 *    #    #  #    #   #  #   #    #    # #    #  #     *
 *    #####   ######  #    #  #          #    #    #    *
 *    #    #  #    #  ######  #  ###     #    ######    *
 *    #    #  #    #  #    #  #    #     #    #    #    *
 *    #####   #    #  #    #   ####      #    #    #    *
 ********************************************************/

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
using namespace std;

#define N  100005

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS;
	while(TESTS--)
	{
		int n,i,j;
		cin>>n;
		char str[n];
		cin>>str;
		char arr[n+1];
		for(i=1;i<=n;i++)
		{
			arr[i]=str[i-1];
		}
		int num=0;
		for(i=1;2*i<=n;i++)
		{
			int flag=1;
			for(j=1;j<=i;j++)
			{
				if(arr[j]!=arr[i+j])
				{
					flag=0;
					break;
				}
			}
			if(flag==1)
			{
				num=i;
			}
		}
		if(num==0)
		{
			cout<<n;
			return 0;
		}
		cout<<n-num+1;
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    scanf("%d",&n);
    string s;
    cin>>s;
    char a=s[0];
    string t="";
    t+=a;
    int count1=s.size(),j;
    for(int i=1;i<=s.size()/2;i++){
        if(s[i]!=a) t+=s[i];
        else {
            string y="";
            for(j=i;j<2*i;j++) if(s[j]==s[j-i]) y+=s[j]; else break;
            if(y==t&&count1>(i+s.size()-j+1)) count1=i+s.size()-j+1;
            t+=s[i];
        }
    }
    cout<<count1;

}

#include <bits/stdc++.h>

std::string buf;

int n;

int main(){
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(NULL);
	std::cout.tie(NULL);

	std::cin>>n>>buf;
	for(int i=n/2;i>=1;i--){
		if(buf.substr(0,i)==buf.substr(i,i)){
			std::cout<<n-i+1<<std::endl;
			return 0;
		}
	}
	std::cout<<n<<std::endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    string s;
    cin >> n >> s;
    int ans = n;
    for(int i = 1 ; i <= n/2 ; i++)
    {
        if(s.substr(0,i) == s.substr(i,i))
            ans = n - i + 1 ;
    }
    cout << ans << endl;

    return 0;
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
const int N = 1e5+10;
const ll Maxn = 1e16;
const int MOD = 1e9 + 7;
const int p = 998244353;

string a;

int main(){
	int n, ans;
	cin >> n;
	cin >> a;
	ans = n;
	int p = 0;
	for(int i = n /2; i >= 0; i--){
		for(int j = 0; j <= i; j++){
			if(a[j] != a[i + j + 1]){
				p = 0;
				break;
			}
			else{
				p = 1;
			}
		}
		if(p == 1){
			printf("%d\n", n - i);
			return 0;
		}
	}
	printf("%d\n", n);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >>n;
	string s;
	cin >>s;
	int ans=n;
	int haha=1;
	for(int i=2;i<=n/2;i++){
		bool ok=true;

			string x= s.substr(0,i);
		/*	cout <<x<<endl;*/
			int k =i;
				/*cout <<k <<endl;*/
				if(s.substr(k,i)==x){
				/*	cout << k<<endl;*/

					haha=max(i,haha);
				/*	break;*/
				}

		/*	if(!ok) break;*/

       /* cout <<endl;*/
 	}

cout <<ans-(haha-1)<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n;
	string s;
	cin>>n>>s;
	for(int i=n/2;i>0;i--)
		if(string(s,0,i)==string(s,i,i)) {
			cout<<n-i+1;
			return 0;
		}
	cout<<n<<endl;
	return 0;
}

/*
    In the name of
        "ALLAH"
    And say "AL-HAMD-U-LILLAH"
*/

#include<bits/stdc++.h>
#define ll long long
#define llu unsigned long long
#define _  printf("\n")
int take() {
    int n;
    scanf("%d",&n);
    return n;

}
double ttake() {
    double n;
    scanf("%lf",&n);
    return n;
}
ll takes() {
    ll n;
    scanf("%lld",&n);
    return n;

}

#define Int take()
#define Dnt ttake()
#define LL takes()
#define done {return 0;}
#define fr(i,x,n,a) for(int i=x;i<=n;i+=a)
#define FR(a,b,x) for(int i=(a);i<=(b);i+=(x))
#define rfr(i,x,n,a) for(int i=x;i>=n;i--)
int cas;
#define print printf("Case %d:",++cas)
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define pii pair<int,int>
#define vii vector<pii>
#define pll pair<ll,ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define mk  make_pair
#define fill(x,v) memset(x,v,sizeof x)

using namespace std;

bool approximatelyEqual(float a, float b, float epsilon) {
    return fabs(a - b) <= ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}

bool essentiallyEqual(float a, float b, float epsilon) {
    return fabs(a - b) <= ( (fabs(a) > fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}

bool definitelyGreaterThan(float a, float b, float epsilon) {
    return (a - b) > ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}

bool definitelyLessThan(float a, float b, float epsilon) {
    return (b - a) > ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
#define STR {struct info}
#define dbg(x) {cout<<"ekhane"<<x<<endl;}
#define  SS second
#define  FF first
#define PQ priority_queue
#define great greatest
#define less lesser
#define mii map<int,int>
#define mil map<int,ll>
#define mll map<ll,ll>
#define msb map<string,bool>
#define V vector
#define M 100005
#define pf printf
//////////////////////////////////////////

int main(){

   string s , cur ="" ; cin>>s>>s ;
   int mn = 0 ;

   fr( i , 1 , s.size() , 1 ){
        cur += s[ i - 1 ] ;
        int y = 0 ;
        fr( k , 1 , cur.size() , 1 ){
            if( k + i  > s.size() || s[ i + k - 1 ] != cur[ k - 1 ] ){
                y++ ;break ;
            }
        }
     if( !y ){
        mn = max( mn , (int )cur.size() ) ;
     }
   }
   // dbg( mn ) ;
    pf("%d\n",min( (int)s.size() , ( (int)s.size() - mn ) + 1 ) ) ;

    done;
}

#include<iostream>
using namespace std;
int main()
{
    int n,i,j=0;
    string s;
    cin>>n>>s;
    for(i=1;i<=n/2;i++)
        if(s.substr(0,i)==s.substr(i,i))
            j=i;
    cout<<min(n,n-j+1)<<endl;
}

/*
*/
#include <bits/stdc++.h>

#define rust(a, b, c, d) sqrt(sqr(a - c) + sqr(b - d))
#define sqr(a) (a)*(a)
#define m_p make_pair
#define fi first
#define se second
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);
#define endl "\n"
#define pll pair <ll,ll>
#define vl vector <ll>

typedef long long ll;
const int MAXINT=2147483640;
const ll MAXLL=9223372036854775800LL;
const ll MAXN=1000000;
const double eps = 1e-9;
const ll mod = 1e9 + 7;
using namespace std;

ll binpow(ll a, ll n)
{
    ll ans = 1;
    while (n)
    {
        if (n&1) ans*=a;
        a*=a;
        n >>= 1;
    }
    return ans;
}
ll n, ans = 1e18, kek;
int main()
{
    srand(time(0));
    //freopen("1.in","r",stdin);
    //freopen("1.out","w",stdout);
    fast_io;
    string s;
    cin >> n;
    cin >> s;
    string s1;
    for (int i = 0; i < s.size(); ++i){
        s1 += s[i];
        ++kek;
        if (s1.size() * 2 <= s.size()){
            if (s1 + s1 == s.substr(0, 2 * s1.size())){
                ans = min(kek + 1 + (s.size() - 2 * s1.size()), ans);
            }
        }
    }
    ans = min(kek, ans);
    cout << ans << endl;

    return 0;
}

#include<iostream>
#include<string>
using namespace std;
int main(){
  int n;
  cin>>n;
  string s;
  cin>>s;
 int t=0;
  int brojac=0;
  for(int i=s.size()/2;i>0;i--){
  t=0;
        brojac=0;
    for(int j=0;j<i;j++){
      if(s[j]==s[j+ i] ){

            if(t==0){
        brojac++;
            }

    }else{
        t=1;
    }
    }

    if(brojac>=i){

      cout<<i+(brojac/i) + (n-i*(brojac/i+1));
    return 0;
    }
  }

  cout<<n;
  }

// C++ includes used for precompiling -*- C++ -*-

// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/** @file stdc++.h
 *  This is an implementation file for a precompiled header.
 */

// 17.4.1.2 Headers

// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <unistd.h>
#endif

using namespace std;

int main()
{
	int n;
	cin >> n;

	string s;
	cin >> s;

	int ptr = n;
	int ans = n;

	int compare_value;
	while (ptr > 1)
	{
		if (2*(ptr-1) > n)
		{
			ptr -= 1;
			continue;
		}
		if (s.substr(0, ptr-1) == s.substr(ptr-1, ptr-1))
		{
			ans -= ptr-1;
			cout << ans+1;
			return 0;
		}
		ptr -= 1;
	}
	cout << n << '\n';

	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
    int n;
    scanf("%d", &n);
    char *s = new char[n+1];
    scanf("%s", s);
    int sum=0;
    for(int i=n-1;i>=0;)
    {
        if(i%2==0)
        {
            i--;
            sum++;
            continue;
        }
        else{
            bool flag=true;
            for(int j=0;j<(i/2+1);j++)
            {
                if(s[j]!=s[j+(i/2+1)])
                   {
                    flag=false;
                    break;
                   }

            }
            if(flag==true)
            {
                sum=sum+i/2+1+1;
                break;
            }
            else{
                i--;
                sum++;
            }
        }
    }
    printf("%d", sum);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,L=1;
    string s;
    cin>>n>>s;
    for(int i=1; i<=n; i++)
        if(s.substr(0,i)==s.substr(i,i))
            L=i;
    int ans=n-L+1;
    cout<<ans<<endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

string s;

bool verify(int index) {

	string pre = "";
	string pos = "";
	for (int i = 0; i <= index; i++) {
		pre += s[i];
		pos += s[i+index+1];
	}

	if (pre == pos) return true;
	else return false;
}

int main () {

	int n; scanf("%d", &n);
	cin >> s;

	int reply = 0;

	for (int i = n/2-1; i >= 0; i--) {
		if (verify(i)) {
			reply = i;
			break;
		}
	}

	reply++;

	printf("%d\n", reply+1+(n-2*reply));

	return 0;
}

#include <iostream>

char s[101];

bool matched(int j)
{
    for (int i = 0; i < j; ++i)
        if (s[i] != s[i + j])
            return false;
    return true;
}

int main()
{
    int n;
    scanf("%d%s", &n, s);

    for (int j = n / 2; j > 1; --j)
        if (matched(j))
        {
            printf("%d\n", n - j + 1);
            return 0;
        }

    printf("%d\n", n);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define          IOS                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          EPS                    10E-10
#define          ull                    unsigned long long int
#define          db                     double
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          vi                     vector<int>
#define          vl                     vector<ll>
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
#define          input                  freopen("input.txt","rt", stdin)
#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     3.141592653589793238462643
#define          rep( i , a , b )       for( i=a ; i<b ; i++)
#define          rev( i , a , b )       for( i=a ; i>=b ; i--)
#define          repx( i ,a,b, x)       for( i=a ; i<b ; i+=x)
#define          RUN_CASE(t,T)          for(__typeof(t) t=1;t<=T;t++)
#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          get_pos(c,x)           (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          CASEL(t)               printf("Case %d:\n",t)
#define          Unique(X)             (X).erase(unique(all(X)),(X).end())
#define          N                      10000000+7

ll A[1000000];
ll B[1000000];
int main()
{
    // input;
    // output;
    // cout<<"Case "<<i<<": ";
    IOS;
    vector<ll>v;
    map<string,ll>mp;
    ll n;
    cin>>n;
    string s,str;
    cin>>s;
    for(ll i=0; i<n; i++)
    {
        ll val=0;
        str=s.substr(0,i+1);
        // cout<<str<<endl;
        ll f=i+1;
        f=s.find(str,f);
        if(f!=string::npos)
        {
            if(f==i+1)val=1;
        }
        mp[str]=val;
        str.clear();
    }
    map<string,ll>::iterator it;
    for(it=mp.begin(); it!=mp.end(); it++)
    {
        string key=it->first;
        ll value=it->second;
        // cout<<key<<" "<<value<<endl;
        ll res=key.size()+value+(s.size()-(key.size()*(value+1)));
        v.push_back(res);
    }
    cout<<*min_element(v.begin(),v.end())<<endl;

    return 0;
}
/*

*/

#include<bits/stdc++.h>
using namespace std;
int main(){
    int m;
    string s;
    int num;
    while(scanf("%d",&m)!=EOF){
        cin>>s;
        num=m;
        for(int i=1;i<=m/2;i++){
            if(s.substr(0,i)==s.substr(i,i)){num=i+1+m-i*2;}
        }
        printf("%d\n",num);
    }
}

#include<bits/stdc++.h>
using namespace std;

map<string, int> mp;
int main(void) {
	int n; scanf("%d", &n);
	char a[105];
	int f[105];
	scanf("%s", a + 1);
	int ans = n;
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= i; ++ j) {
			// 1 ~ j - 1 , j ~ i
			bool ok = true;
			if (j - 1 != i - j + 1) continue;
			for (int k = 1; k <= j - 1; ++ k) if (a[k] != a[k + j - 1]){
				ok = false; break;
			}
			if (!ok) continue;
			ans = min(ans, j - 1 + 1 + (n - i));
//			cout << j - 1 + 1 + (n - i) << endl;
//			cout << i << " " << j << endl;
		}
	}
	cout << ans << endl;
	return 0;
}

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n, ans = 1 , c = 1;
	string s;
	cin >> n >> s;
	for (int i = 1; i < n; i++) {
		c = 1;
		if (s[0] == s[i]) {
			int y = i+1;
			int x = 1;
			while (x != i ) {
				if (s[y] == s[x] && y<n ) {
					c++;
					y++;
					x++;
				}
				else {
					c = 0;
					break;
				}
			}

		}
		if (c > ans) { ans = c;  }
	}

	cout <<  n - ans + 1 << endl ;
	return 0;
}

#include <bits/stdc++.h>
#define ll long long int
#define FF first
#define SS second
#define pb push_back
#define rep(i,a,b) for(ll (i) = (a); (i) < (b); (i)++)
#define all(v) (v).begin(),(v).end()
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define inf LONG_MAX
using namespace std;

int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n;
cin>>n;
string s;
cin>>s;
ll ans=1;
rep(i,1,n)
	{
		if(s.substr(0,i)==s.substr(i,i))
				{
					string tmp=s.substr(0,i);
					ll len=tmp.length();
					ans=max(ans,len);
				}
	}
cout<<n-ans+1;

return 0;
}

#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x); i<=(y); i++)
#define ll long long
#define N 105
using namespace std;
int n; char s[N];
int main(){
	scanf("%d%s",&n,s+1); int ans=n;
	rep (i,1,n/2){
		int flag=1;
		rep (j,1,i) if (s[j]!=s[j+i]) flag=0;
		if (flag){
			ans=min(ans,i+n-2*i+1);
		}
	}
	printf("%d\n",ans);
	return 0;
}

#include <bits/stdc++.h>

#define inf 0x3f3f3f3f

#define INF 0x3f3f3f3f3f3f3f3fLL

#define mod 1000000007

#define hmod 911382323

#define pb push_back

#define sq(x) ((x)*(x))

#define sz(a) ((int)a.size())

#define LEN(a) (a.length())

#define x first

#define y second

#define ls (u<<1)

#define rs (ls + 1)

#define mid (st + ed >> 1)

#define eps 1e-8

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define rands(n) (rand()%n+1)

#define rand0(n) (rands(n)-1)

#define Rands(n) ((INT)rand()*rand()%n+1)

#define Rand0(n) (Rands(n)-1)

#define PQ priority_queue<pii, vector<pii>, greater<pii> >

#define rep(i, a, b) for(int i=a; i<b; i++)

#define eprintf(...) fprintf(stderr, __VA_ARGS__)

#define shit(a) (1 << (a))

#define all(a) ((a).begin(), (a).end())

#define rev(a) (power(a, mod-2, mod))

#define add_edge(u, v) {nxt[E]=head[u];to[E]=v;head[u]=E++;}

#define init_edge(n) {memset(head, -1, sizeof head);E=0;}

#define input_tree {int n;cin>>n;init_edge(n); for(int i=0, u, v; i<n-1; i++) {gn(u); gn(v); add_edge(u,v); add_edge(v,u);}}

#define ADD(u, v) {u+=v;u%=mod;}

using namespace std;

typedef long long INT;

typedef unsigned long long UINT;

typedef unsigned int uint;

typedef complex<double> Complex;

typedef double DO;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<INT, INT> PII;

typedef pair<pii, int> ppi;

typedef pair<int, pii> pip;

typedef pair<DO, DO> pdd;

typedef pair<int, DO> pid;

typedef pair<DO, int> pdi;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

template<class T>inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}

template<class T>inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}

template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}

template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}

int power(int a, int b, int m, int ans=1) {

	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;

	return ans;

}

inline uint myrand(int n) {

	uint u = rand()%n;

	int c = rand()%10;

	u ^= u << c;

	u^=(u<<7)&263692864;

	u^=(u<<15)&402273075;

	u%=n;

	return u;

}

#define NN 1011

char s[NN];

int dp[2][NN];

int same(int u) {

	for(int i=1, j=u/2+1; j<=u; i++, j++) {

		if(s[i]!=s[j]) return 0;

	}

	return 1;

}

int main() {

#ifndef ONLINE_JUDGE

	freopen("in.in", "r", stdin);

	freopen("out.out", "w", stdout);

	int _time=clock();

#endif

int n;

cin >> n;

	scanf("%s", s+1);

	for(int i=0; i<NN; i++) dp[0][i] = dp[1][i] = inf;

	dp[0][0] = dp[1][0]=0;

	for(int i=1; i<=n; i++) {

		dp[0][i]=dp[0][i-1]+1;

		if(i%2==0 and same(i)) dp[1][i] = dp[0][i/2] + 1;

		smin(dp[1][i], dp[1][i-1]+1);

	}

	cout << min(dp[0][n], dp[1][n]) << endl;

#ifndef ONLINE_JUDGE

	cerr<<"The running time is : " << (DO)(clock()-_time) / CLOCKS_PER_SEC<<endl;

#endif

	return 0;

}

#include <bits/stdc++.h>

using namespace std;

int main() {
    string st;
    int n, ret = 1;
    cin >> n; cin >> st;
    st = " " + st;
    for (int i = 1; i <= n; i++)
        if (st.substr(1, i) == st.substr(i + 1, i))
            ret = max(ret, i);
    cout << n - ret + 1;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define pb push_back
#define ld long double
#define f first
#define s second
#define in insert
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e18 + 5;
const int  N = 2e5 + 314;
const long double pi = 3.1415926535897932384626433832795;
vi a[N];
void solve(){
	int n, mx = 0;
	string s;
	cin>>n>>s;
	for(int i = 0; i < n; i++){
		int k = 0;
		for(int j = i; j < n&&k<i; j++){
			if(s[j]==s[k])k++;
			else break;
		}
		if(k==i)mx=max(mx, k);
	}
	cout<<n-mx+(mx!=0);
}
signed main(){
	speed;
	int t=1;
	//cin>>t;
	while(t--)solve();
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<climits>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<set>
#include<algorithm>

#define ll long long
#define dl double
#define mod 1000000007
#define sz 305
#define szz 100005

using namespace std;

int main()
{
    string str;
    ll n,mx=0;

    cin>>n>>str;

        string ss;
        ss.clear();

        for(ll j=0; j<n; j++)
        {
            ss+=str[j];

            string tt;
            tt.clear();

            ll ff=ss.length(),flag=0;

            for(ll k=j+1; k<n; k++)
            {
                tt+=str[k];

                if(tt==ss)
                {
                    flag=1;
                    break;
                }
            }

            if(flag==1)
                mx=max(mx, ff);
        }

    //printf("mx = %lld\n",mx);

    if(mx>=2)
    {
        n=n-(mx*2);
        n=n+(mx+1);
    }

    printf("%lld\n",n);

    return (0);
}

#include<stdio.h>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include <string>
#include<string.h>
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int n;
	scanf("%d",&n);
	string s;
	cin>>s;
	int ans = 1;
	for(int i= 1;s[i];i++)
	{
		string c=s.substr(0, i);
		if(s.substr(i, c.length()) == c)
			ans = c.length();
	}
	printf("%d\n",n-ans+1);
	return 0;
}

#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
int main() {
	int n;
	while (cin >> n) {
		string str;
		cin >> str;
		int len = str.size();
		int ans = 0;
		for (int i = 1; i <= len/2; ++i)//ö����λ��
		{
		    bool sign=true;
			for (int j = 0;j<i; ++j) {//ö�ٳ���
				if(str[j]!=str[i+j]){
				    sign=false;
				    break;
				}
			}
			if(sign)
			    ans = max(ans, i);
		}
		if (ans == 0)
			cout << len << endl;
		else
			cout << len -ans + 1<< endl;
	}
	return 0;
}

#include <bits/stdc++.h>

#define inf 0x3f3f3f3f

#define MOD 1000000007

#define pb push_back

#define sq(x) ((x)*(x))

#define x first

#define y second

#define eps 1e-9

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define sgn(x) (((x)>eps)-((x)<-eps))

#define PQ priority_queue<pii, vector<pii>, greater<pii> >

using namespace std;

typedef long long INT;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<pii, int> pi3;

typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

template<class T>inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}

template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}

template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}

template<class T>inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}

template<class T>inline void printsp(T x) {print(x); putchar(' ');}

template<class T>inline void println(T x) {print(x); putchar('\n');}

template<class T, class U>inline void print(T x, U y) {printsp(x); println(y);}

template<class T, class U, class V>inline void print(T x, U y, V z) {printsp(x); printsp(y); println(z);}

int power(int a, int b, int m, int ans=1) {

	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;

	return ans;

}

#define NN 1010

char s[NN];

int main() {

#ifndef ONLINE_JUDGE

	freopen("in.in", "r", stdin);

	freopen("out.out", "w", stdout);

#endif

	int n;

	gn(n);

	scanf("%s", s+1);

	int ans=n;

	for (int i=1; i<=n/2; i++) {

		if (strncmp(s+1, s+i+1, i)==0) smin(ans, n-i+1);

	}

	println(ans);

	return 0;

}

#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define IO ios::sync_with_stdio(false);\
    cin.tie(0);\
    cout.tie(0);
const int maxn =107;
string str;
int main()
{
    IO;
    int n;
    cin>>n;
    cin>>str;
    int ans=0;
    for(int len=1;len<=n/2;len++)
    {
        if(str.substr(0,len)==str.substr(len,len))
        {
//            cout<<str.substr(0,len)<<" "<<str.substr(len,len)<<endl;
            ans=max(ans,len);
        }
    }
//    cout<<ans<<endl;
    if(ans==0)
        n--;
    cout<<n-ans+1<<endl;
    return 0;
}

#include <iostream>
#include<string>

using namespace std;
string a;
int main()
{
    int n,ans;
    cin >> n;
    cin >> a;
    ans=n;
    int p=0;
    for(int i=n/2;i>=0;i--)
    {
        for(int j=0;j<=i;j++)
        {
            if(a[j]!=a[i+j+1])
            {
                p=0;
                break;
            }
            else p=1;
        }
        if(p==1)
        {
            cout << n-i<< endl;
            return 0;
        }
    }
    cout << n << endl;
    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <fstream>
#include <cmath>
using namespace std;

int main() {
	int32_t out = 0;
	std::cin >> out;
	std::string inp;
	std::cin >> inp;
	out = 0;
	int32_t max = 0;
	bool check = true;
	for (int32_t i = 0; i < inp.size() / 2; i++) {
		check = true;
		for (int32_t j = 0; j <= i; j++) {
			if (inp[j] != inp[i + j + 1]) {
				check = false;
				break;
			}
		}
		if (check) max = i;
	}
	if (max != 0) {
		out = (max + 1) + 1 + (inp.size() - (max + 1) * 2);
	}
	else {
		out = inp.size();
	}
	std::cout << out;
	return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    char str[110];
    int n;
    scanf("%d",&n);
    scanf("%s",str);
//    int next[10000];
//    memset(next,0,sizeof(next));
//    next[0]=-1;
//    int j;
//    for(int i=0; i<n; i++)
//    {
//        j=i;
//        while(j!=-1)
//        {
//            if(str[i]==str[next[j]]&&next[j]!=-1)
//            {
//                next[i+1]=next[j]+1;
//                break;
//            }
//            else
//            {
//                j=next[j];
//            }
//        }
//        if(next[j]==-1)
//            next[i+1]=0;
//    }
    int result=100000;
    int Max;
    for(Max=1; Max<=n/2; Max++)
    {
        int k=0;
        if(Max==0)
        {
            k=n;
        }
        else
        {
            int flag=0;
            for(int i=Max; i<n;)
            {
                int m=i;
                for(int j=0; j<Max;)
                {
                    if(str[j++]==str[m++])
                    {
                    }
                    else
                    {
                        flag=1;
                        break;
                    }
                    if(j==Max)
                    {
                        i+=Max;
                        k++;
                        break;
                    }
                }
                if(flag==1)
                {
                    k=k+(n-k*Max);
                    result=result>k?k:result;
//                    cout<<"11:"<<result<<endl;
                    break;
                }
            }
            if(flag==0)
            {
                k=Max+k;
                result=result>k?k:result;
//                cout<<"22:"<<result<<endl;
            }
        }
    }
    printf("%d\n",result);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main () {
	ios_base::sync_with_stdio (false);
	int n{}, a{};
	string s{};
	cin >> n >> s;
	a = n;
	for (int i = 1; i <= n/2; i++)
	{
		//cout << "substr(i) " << s.substr (0, i) << " " << "substr(i,i) " << s.substr (i, i) << "\n";
		if (s.substr (i) == s.substr (i, i))
		{
			a = i + 1 + n - i * 2;
		}
	}
	cout << a << endl;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define pp pop_back
#define pi pair<ll,ll>
#define pii pair<int,int>
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll n,i,j,k,l,m,b,t,sum,sum1,flag,max1,min1,tmp;
    cin>>n;
    string s,s1,s2;
    cin>>s;
    map<char,ll>mp;sum=0;map<string,ll>mp1;s2="";
    for(i=0;i<n;i++){
        mp[s[i]]++;
        if(mp[s[i]]==1){
            sum++;
        }else{
            s1=s.substr(0,i);
//            s2+=s[i];
//            cout<<s1<<endl;
//            mp1[s1]++;
            if(i+i>n){
                sum++;
                continue;
            }
            string s3="";
            for(j=i;j<i+i;j++){
                s3+=s[j];
            }
            if(s3==s1){
                sum++;
                i=j-1;
            }
        }

    }
    cout<<sum<<endl;

}

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,kalo=0,maxi=0;
    string s,t="",temp="";
    map <string,int> ma;
    map <string,int> :: iterator it;
    cin>>n>>s;

    int sz = s.size(),f=0;

    for(int i=0; i<sz-1; i++)
    {
        for(int j=1; j<=sz-i; j++)
        {
            string temp = s.substr(i,j);
            ma[temp]++;

            if(ma[temp]>1) f=1;
            if(temp.size()>maxi && temp.size()*2<=n && ma[temp]>1) { maxi = temp.size(); }
        }
    }

    if(f==0) cout << n << endl;

    else
    {
        cout <<  maxi+1+(n-maxi*2) << endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,d=0,e=0;
	cin>>a;
	string b;
	cin>>b;
	int c;
	c=a;
	while(c!=2){
		if(c%2==0){
			for(int i=0;i<b.size();i++){
				for(int j=i;j<i+(c/2);j++){
					if(b[j]!=b[i+(c/2)+d]){
						e=1;
						break;
					}
					d++;
				}
				d=0;
			if(e==0){
				cout<<a-(c/2)+1;
				return 0;
			}
			e=0;
		}
	}
	c--;
	}
	cout<<a;
}

#include <iostream>     // std::cout
#include <algorithm>    // std::sort
#include <vector>       // std::vector
#include <bitset>
using namespace std;

int main () {

    int n;
    scanf("%d", &n);
    char c[n];
    scanf("%s", c);
    int same=0;
    int best=0;
    for(int i=1; i<n; i++)
    {
        if(c[i]==c[same] && (2*(same+1))<=(i+1))
        {
            same++;
            if(same>best)
                best=same;
        }
        else if(c[i]==c[same])
        {
            same=1;
            if(same>best)
                best=same;
        }
        else
        {
            if(same>best)
                best=same;
            same=0;
        }
    }
    if(best==0)
        cout<<n;
    else
        cout<<(n-(best-1));
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#include <string>         // std::string

int main()
{
    int n;
    string s;
    cin>>n>>s;
    int ans = 0;
    for(int f=0; f<n; f++) {
        for(int l=f; l<=n; ++l){
            string one = s.substr(0,f);
            string twe = s.substr(l,n-l);
            if(twe.find(s.substr(f,l-f)) != std::string::npos || one.find(s.substr(f,l-f)) != std::string::npos) {
                ans = max ( ans , l-f);
            }
        }
    }
    if(ans){
        cout << s.size() - ans +1;
        return 0 ;
    }
    cout<<s.size();
}

#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

#define DEBUG printf("Passing [%s] in Line %d\n" , __FUNCTION__ , __LINE__) ;

const int MAX_N = 100 + 10 ;

int n ;
char st[MAX_N] ;

bool cmp(int x , int y , int l) {
	for (int i = 0 ; i < l ; ++i)
		if (st[x + l] != st[y + l]) return 0 ;

	return 1 ;
}

int main() {
	scanf("%d" , &n) ;
	scanf("%s" , st) ;

	///

	int tmp = 1 ;
	for (int i = 1 ; i < n ; i += 2)
		if (i % 2) {
			int len = (i + 1) >> 1 , st = i - len + 1 ;
			if (cmp(0 , st , len)) tmp = std::max(tmp , len) ;
		}

	printf("%d\n" , n - tmp + 1) ;

	return 0 ;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main ()
{
    ll n;string s; cin>>n>>s;
    ll ans = 1;
    for(ll i=0;i<s.size()/2;i++)
    {
        bool BOOL = true;
        for(ll j=i+1;j<i+i+1;j++)
        {
            if(s[j]!=s[j-i-1]) {BOOL = false;break;}
        }
        if(BOOL == true) ans = i+1;
    }
    cout<<n-ans+1;
}

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int n,f[110];
char s[110];
int main(){
	scanf("%d%s",&n,s+1);
	memset(f,127/3,sizeof(f));
	f[0]=0;
	for(int i=1;i<=n;i++){
		if(i%2==0){
			int falg=0;
			for(int j=1;j<=i/2;j++)
				if(s[j]!=s[j+i/2]){
					falg=1;break;
				}
			if(falg==0)f[i]=f[i/2]+1;
		}
		f[i]=min(f[i],f[i-1]+1);
	}
	printf("%d\n",f[n]);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    string a;
    cin>>a;
    int sum=0;
    while(a.size())
    {
        if(a.size()%2)
        {
            a.erase(a.size()-1,1);
            sum++;
            continue;
        }
        int flag=0;
        for(int i=0;i<=a.size()/2-1;i++)
        {
            if(a[i]!=a[i+a.size()/2])
            {
                flag=1;
                break;
            }
        }
        if(!flag)
        {
            sum+=a.size()/2;
            break;
        }
        else
        {
            a.erase(a.size()-1,1);
            sum++;
        }
    }
    cout<<sum+1;
    return 0;
}

	#include<bits/stdc++.h>
	using namespace std;

	int findopt(int r)
	{
	    if(r==0)return 0;
	    for(int i=sqrt(r);i>0;i--)
        {
            if(r%i==0)
                return i;
        }
	}

int main()
{
     int n;
     cin>>n;
     string s;
     cin>>s;
    // vector <pair <int,int> > v;
    int length=1;
     char start=s[0];
     int startindex=0;
     int rep=1;
     int pairnumber=0;
     for(int i=1;i<n;i++)
     { int m=i;
       //cout<<endl<<"startindex is "<<startindex;
        if(s[i]==start)
        {   int j;
            for( j=startindex+1;j<m;j++)
            {
                if(s[j]==s[++i])
                {

                }
                else
                {
                  i=m;
                  break;
                }
            }
            if(j==m)
            {
              rep++;
            length=m-startindex;
            start=s[m];
            startindex=m;
            }
        }
     }
     //cout<< "length and repitition is "<<length<<" and  "<<rep;
     int result,total;
     if(rep>length)
     {
       total=length*rep;
     length=findopt(total);
     //cout<<endl<<length<<endl;
     rep=total/length ;
     }

     result=(length+rep-1)+n-(length*(rep));
     cout<<result;

}

#include<stdio.h>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include <string>
#include<string.h>
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int i,j,k,m,n,num=0;
	char a[200];
	scanf("%d",&n);
	scanf("%s",a);
	for(i=n/2;i>=2;i--)
	{
		for(j=0;j<=n-i-i-1;j++)
		{
			string b(a,j,j+i);
			for(k=j+i;k<=n-i-1;k++)
			{
				string c(a,k,k);
				if(b==c)
				{
					printf("%d\n",n-i+1);
					return 0;
				}
			}
		}
	}
	printf("%d\n",n);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

#include <c++/ext/pb_ds/assoc_container.hpp>
#include <c++/ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fi(a,b) for(int i=a;i<b;i++)
#define fj(a,b) for(int j=a;j<b;j++)
#define ff first
#define ss second
#define ll long long
#define ull unsigned long long
#define bp(x) __builtin_popcount(x)
#define pr(x) for(auto it: x) cout<<it<<" "; cout<<endl;
#define endl "\n"
typedef vector<int> vi;
typedef vector< pair<int,int> > vii;
typedef vector<long long> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector< pair<long,long> > vll;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define ordered_multiset tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update>
//find_by_order(k) - no. of elements strictly smaller than k
//order_of_key(k) - index of element k (starting from 0)

void nikal_pehli_fursat_mai(){
  int n;
  cin>>n;
  string s;
  cin>>s;
  int ans=n;
  fi(0,n){

  }
  cout<<ans<<endl;
}

int main(){
  #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  #endif
  ios::sync_with_stdio(0);
  cin.tie(0);
  nikal_pehli_fursat_mai();
}

#include <iostream>
#include <math.h>
#include <iomanip>
#include <bits/stdc++.h>
#include <string.h>
#include <string>
#include <algorithm>
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define N 100005
#define inf 1e18
#define mem(a,b) memset(a,b,sizeof(a))
#define debug(x) cout << (#x) << " = " << x << endl;
#define debug2(i,j) cout << (#i) << "=" << i << " , " << (#j) << "=" << j << endl;

using namespace std;

ll binomialCoeff(ll n,ll k)
{
    ll res = 1;
    if(k >n - k)
        k = n - k;
    for(int i = 0; i < k; ++i)
    {
        res *= (n - i);
        res /= (i + 1);
    }
    return res;
}

ll power(ll x,ll y)
{
    ll temp;
    if(y == 0)
        return 1;
    temp = power(x, y/2);
    if (y%2 == 0)
        return temp*temp;
    else
        return x*temp*temp;
}

/* nCr % mod
ll fact[6*N];
ll inv[6*N],invfac[6*N];
ll mod = 998244353;

void factorial()
{
    fact[0] = invfac[0] = fact[1] = invfac[1] = 1;
    inv[1] = 1;
    for(int i=2;i<=5*N + 10;i++)
    {
        fact[i] = (fact[i-1]*i)%mod;
        inv[i] = (inv[mod%i]*(mod - mod/i))%mod;
        invfac[i] = (invfac[i-1]*inv[i])%mod;
    }
}*/

vector<ll> primes;

void Sieve(int n)
{
    vector<bool> prime(n+1,true);
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          primes.push_back(p);
}

//******************************************************    CHECK CONSTRAINTS   ***************************************************************//

const int Nmax = 5e6 + 6;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n;
    cin >> n;
    string str;
    cin >> str;
    int c = 0;
    int best = 0;
    int ind = 0;
    //append at end -_-
    for(int i=0;i<n;i++)
    {
        for(int j=i;j<n;j++)
        {
            ind = i;
            c = 0;
            for(int k=j+1;k<n;k++)
            {
                if(ind > j)
                    break;
                if(str[ind] == str[k])
                {
                    c++;
                    ind++;
                }
                else
                    break;
            }
            best = max(best,c);
        }
    }
    if(best)
        n++;
    cout << n - best ;
}

#include <iostream>
using namespace std;
int i,n,f[10000];
string s;
int check(int x)
{
	if (x%2==1) return 0;
	int l=1;
	while (l<=x/2)
	{
		if (s[l]!=s[l+x/2]) return 0;
		l++;
	}
	return 1;
}
int main() {
	cin>>n;
	cin>>s;
	s=' '+s;
	f[1]=1;
	for (i=2;i<=n;i++)
	{
		f[i]=f[i-1]+1;
		if (check(i))
		if (f[i]>f[i/2]+1)
		f[i]=f[i/2]+1;
	}
	cout<<f[n];
	return 0;
}

#include <bits/stdc++.h>

#define inf 0x3f3f3f3f

#define INF 0x3f3f3f3f3f3f3f3fLL

#define mod 1000000007

#define hmod 911382323

#define pb push_back

#define sq(x) ((x)*(x))

#define sz(a) ((int)a.size())

#define LEN(a) (a.length())

#define x first

#define y second

#define ls (u<<1)

#define rs (ls + 1)

#define mid (st + ed >> 1)

#define eps 1e-8

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define rands(n) (rand()%n+1)

#define rand0(n) (rands(n)-1)

#define Rands(n) ((INT)rand()*rand()%n+1)

#define Rand0(n) (Rands(n)-1)

#define PQ priority_queue<pii, vector<pii>, greater<pii> >

#define rep(i, a, b) for(int i=a; i<b; i++)

#define eprintf(...) fprintf(stderr, __VA_ARGS__)

#define shit(a) (1 << (a))

#define all(a) ((a).begin(), (a).end())

#define rev(a) (power(a, mod-2, mod))

#define add_edge(u, v) {nxt[E]=head[u];to[E]=v;head[u]=E++;}

#define init_edge(n) {memset(head, -1, sizeof head);E=0;}

#define input_tree {int n;cin>>n;init_edge(n); for(int i=0, u, v; i<n-1; i++) {gn(u); gn(v); add_edge(u,v); add_edge(v,u);}}

#define ADD(u, v) {u+=v;u%=mod;}

using namespace std;

typedef long long INT;

typedef unsigned long long UINT;

typedef unsigned int uint;

typedef complex<double> Complex;

typedef double DO;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<INT, INT> PII;

typedef pair<pii, int> ppi;

typedef pair<int, pii> pip;

typedef pair<DO, DO> pdd;

typedef pair<int, DO> pid;

typedef pair<DO, int> pdi;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

template<class T>inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}

template<class T>inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}

template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}

template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}

int power(int a, int b, int m, int ans=1) {

	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;

	return ans;

}

inline uint myrand(int n) {

	uint u = rand()%n;

	int c = rand()%10;

	u ^= u << c;

	u^=(u<<7)&263692864;

	u^=(u<<15)&402273075;

	u%=n;

	return u;

}

#define NN 1011

char s[NN];

int dp[2][NN];

int same(int u) {

	for(int i=1, j=u/2+1; j<=u; i++, j++) {

		if(s[i]!=s[j]) return 0;

	}

	return 1;

}

int main() {

#ifndef ONLINE_JUDGE

	freopen("in.in", "r", stdin);

	freopen("out.out", "w", stdout);

	int _time=clock();

#endif

int n;

cin >> n;

	scanf("%s", s+1);

	for(int i=0; i<NN; i++) dp[0][i] = dp[1][i] = inf;

	dp[0][0] = dp[1][0]=0;

	for(int i=1; i<=n; i++) {

		dp[0][i]=min(dp[0][i-1], dp[1][i-1]) + 1;

		if(i%2==0 and same(i)) dp[1][i] = dp[0][i/2] + 1;

	}

	cout << min(dp[0][n], dp[1][n]) << endl;

#ifndef ONLINE_JUDGE

	cerr<<"The running time is : " << (DO)(clock()-_time) / CLOCKS_PER_SEC<<endl;

#endif

	return 0;

}

///...................................*****.................................................///
///                  Mujahidul Islam ( mujahidulislam2923@gmail.com )                       ///
///                  Department of Ict                                                      ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

#define          CIN                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          ull                    unsigned long long int
#define          db                     double
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          vi                     vector<int>
#define          vl                     vector<ll>
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          mp                     make_pair
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
#define          input                  freopen("input.txt","rt", stdin)
#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     3.141592653589793238462643
#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          Upper(c,x)           (upper_bound(c.begin(),c.end(),x)-c.begin())
#define          Lower(c,x)           (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          Unique(X)             (X).erase(unique(all(X)),(X).end())

///priority_queue<int,vector<int>,greater<int> >pq;
///string str = "abcdefghijklmnopqrstuvwxyz";
///string s2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;

///---------------Order set-------------------
///template<typename T> using orderset =tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
///#include <ext/pb_ds/assoc_container.hpp>
///using namespace __gnu_pbds;
///*os.find_by_order(index) os.order_of_key(value)

///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------
///sort( all( v ) ) ;

vl v, v1, v2 ;
vector < pll > vec ;
map < string, ll > Mp ;
set < string > st ;

int main()
{
    CIN ;
    ll n ;
    string s ;
    cin >> n >> s ;
    for( int j = 1 ; j <= n / 2 ; j ++ )
    {
        int x = n % j ;
        for( int k = 0 ; k <= x ; k ++ )
        {
            for( int i = k ; i <= s.size() - j ; i += j )
            {
                string str = s.substr( i, j ) ;
                Mp[ str ] ++ ;
                //cout << str << endl ;
            }
        }
    }
    for( auto x : Mp )
    {
        v.pb( x.first.size() + x.second - 1 +  n - ( x.first.size() * x.second ) ) ;
    }
    sort( all( v ) ) ;
    cout << v[ 0 ] << endl ;
    return 0;
}

#include<bits/stdc++.h>
#define sync ios::sync_with_stdio(false)
#define pb push_back
#define mp make_pair
#define inf LONG_LONG_MAX
#define mod1 1000000007
#define mod2 100000009
#define lt long long int
#define endl '\n'

using namespace std;
int toint(const string &s){ stringstream ss; ss<<s; int x; ss>>x; return x; }

int main()
{
    sync;

    int n;
    cin>>n;

    string s;
    cin>>s;

    int cnt = n;
	int len = 1;
	int flag = 0;

	while(len < n/2)
	{
		flag = 0;
		for(int i = 0; i < len; i++)
		{
			if(s[i] != s[i+len])
			{
				flag = 1;
				break;
			}
		}
		if(flag != 1)
		{
			cnt = min(cnt, n-len+1);
		}
		len++;
	}

	cout<<cnt<<'\n';
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,f=1;
    cin>>n;
    string s,k="";
    cin>>s;
    int i,j,ans=s.size();
    k+=s[0];
    k+=s[1];
    for(i=2;i<s.size();i++)
    {
        string l="";
        for(j=i;j<2*i && j<s.size();j++)
        {
            l+=s[j];
        }
        if(l==k)
        {
            k+=l;
            ans-=l.size();
            ans+=f;
            f++;
            i=j-1;
        }
        else
            k+=s[i];
    }
    cout<<ans;

}

#include<bits/stdc++.h>
using namespace std;

#define          IOS                    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define          ll                     long long int
#define          EPS                    10E-10
#define          ull                    unsigned long long int
#define          db                     double
#define          pii                    pair < int, int>
#define          pll                    pair < ll, ll>
#define          MOD                    1000000007
#define          vi                     vector<int>
#define          vl                     vector<ll>
#define          pb                     push_back
#define          sc                     scanf
#define          pf                     printf
#define          scin(x)                scanf("%d",&(x))
#define          scin2(x,y)             scanf("%d %d",&(x),&(y))
#define          scln(x)                scanf("%lld",&(x))
#define          scln2(x,y)             scanf("%lld %lld",&(x),&(y))
#define          min3(a,b,c)            min(a,min(b,c))
#define          min4(a,b,c,d)          min(d,min(a,min(b,c)))
#define          max3(a,b,c)            max(a,max(b,c))
#define          max4(a,b,c,d)          max(d,max(a,max(b,c)))
#define          ms(a,b)                memset(a,b,sizeof(a))
#define          gcd(a, b)              __gcd(a,b)
#define          lcm(a, b)              ((a)*(b)/gcd(a,b))
#define          input                  freopen("input.txt","rt", stdin)
#define          output                 freopen("output.txt","wt", stdout)
#define          PI                     3.141592653589793238462643
#define          rep( i , a , b )       for( i=a ; i<b ; i++)
#define          rev( i , a , b )       for( i=a ; i>=b ; i--)
#define          repx( i ,a,b, x)       for( i=a ; i<b ; i+=x)
#define          RUN_CASE(t,T)          for(__typeof(t) t=1;t<=T;t++)
#define          zero(a)                memset(a,0,sizeof a)
#define          all(v)                 v.begin(),v.end()
#define          get_pos(c,x)           (lower_bound(c.begin(),c.end(),x)-c.begin())
#define          CASEL(t)               printf("Case %d:\n",t)
#define          Unique(X)             (X).erase(unique(all(X)),(X).end())
#define          N                      10000000+7
/*
l NcR[200010][2];

l ncr(int n,int r)
{
    if(r==0)return 1;
    if(r==1)return n;
    if(n==r)return 1;
    if(NcR[n][r]!=0)
    {
        return NcR[n][r];
    }
    else
    {
        NcR[n][r]=ncr(n-1,r)+ncr(n-1,r-1);
        return NcR[n][r];
    }
}
*/

///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------
/*
ll knx[]= {+2,+2,+1,+1,-1,-1,-2,-2};
ll kny[]= {-1,+1,-2,+2,-2,+2,-1,+1};
*/
map<string, ll>month ;
void Month()
{
    month["January"] = 1, month["February"] = 2, month["March"] = 3, month["April"] = 4, month["May"] = 5, month["June"] = 6 ;
    month["July"] = 7, month["August"] = 8, month["September"] = 9, month["October"] = 10, month["November"] = 11, month["December"] = 12 ;
}

ll A[1000000];
ll B[1000000];
int main()
{
    // input;
    // output;
    // cout<<"Case "<<i<<": ";
    IOS;
    vector<ll>v;
    map<string,ll>mp;
    ll n;
    cin>>n;
    string s,str;
    cin>>s;
    for(ll i=0;i<n;i++)
    {
        ll val=0;
        str=s.substr(0,i+1);
       // cout<<str<<endl;
        ll f=-1;
       while(1)
       {
            f=s.find(str,f+1);
           if(f!=string::npos)
           {
               val++;
               f+=str.size();
              // cout<<"f = "<<f<<endl;
           }
           else break;

       }
        mp[str]=val;
        str.clear();
    }
    map<string,ll>::iterator it;
    for(it=mp.begin();it!=mp.end();it++)
    {
        string key=it->first;
        ll value=it->second;
       // cout<<key<<" "<<value<<endl;
        ll res=key.size()+value-1+(s.size()-(key.size()*value));
        v.push_back(res);
    }
    cout<<*min_element(v.begin(),v.end())<<endl;

    return 0;
}
/*

*/

#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

#define DEBUG printf("Passing [%s] in Line %d\n" , __FUNCTION__ , __LINE__) ;

const int MAX_N = 100 + 10 ;

int n ;
char st[MAX_N] ;

bool cmp(int x , int y , int l) {
	for (int i = 0 ; i < l ; ++i)
		if (st[x + l] != st[y + l]) return 0 ;

	return 1 ;
}

int main() {
	scanf("%d" , &n) ;
	scanf("%s" , st) ;

	///

	int tmp = 1 ;
	for (int L = 2 ; (L << 1) <= n ; ++L)
		if (cmp(0 , L , L)) tmp = std::max(tmp , L) ;

	printf("%d\n" , n - tmp + 1) ;

	return 0 ;
}

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <sstream>
#include <cstdio>
#include <string>
#include <fstream>
#include <vector>
#include <map>
#include <algorithm>
#include <set>

using namespace std;

int main() {
	//ifstream cin("in.txt");
	//ofstream cout("out.txt");
	int n, ans = 0;
	string s;
	cin >> n;
	cin >> s;
	for (int i = 2; i <= n; i += 2) {
		string s1, s2;
		s1 = s.substr(0, i / 2);
		s2 = s.substr(i / 2, i / 2);
		if (s1 == s2) {
			ans = n / 2 - 1;
		}
	}
	cout << n - ans;
	return 0;
}

#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <iomanip>
#define ll long long
#include <iostream>
#include <cstring>
using namespace std;
int main()
{

    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    string s,s1,s2,s3;
    ll g,i,j,k,n,m,z,l,r;
    cin >> n;
    cin >> s;
    i = 0;
    g = 0;
    z = 0;
    while (i < n)
    {
        s1+=s[i];
        g++;
        s2 = s.substr(i+1,g);
        if (s1 == s2)
        {
            l = g;
        }
        z++;
        i ++;
    }
    cout << n-l+1;

}

#include<bits/stdc++.h>
using namespace std;

#define testcases int t; cin>>t; while(t--)
#define int long long
const int MOD =  1e9 + 7;
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

int32_t main()
{

#ifndef ONLINE_JUDGE
    freopen("inputf.in", "r", stdin);
    freopen("outputf.in", "w", stdout);
#endif

    FASTIO;

    int n;
    cin >> n;

    string s;
    cin >> s;

    int maxi = 0;

    for (int i = 0; i < n; i++)
    {

        if (i + 1 > n - i ) break;

        int len = 0;
        for (int j = i + 1, idx = 0; j < n && idx <= i && s[idx] == s[j]; j++, idx++)
        {
            len++;
        }

        maxi = max(maxi, len);

    }
    // cout << maxi << endl;

    cout << n - 2 * maxi + maxi + (maxi != 1);

}

#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <map>
using namespace std;
#define lon long long
int main()
{
    int n, i, j, cnt=0,mx=0;
    string s;
    vector <string> vc;
    vector <int> mn, mmx;
    cin >> n;
    cin >> s;
    int m = n/2;
    while(m>1) {
        for(i=0; i+m <=n; i++) {
            string ss;
            for(j=i; j<i+m; j++) ss+=s[j];
            vc.push_back(ss);
            mn.push_back(i);
            mmx.push_back(i+m-1);
        }
        m--;
    }
    m = vc.size();
    for(i=0; i<m; i++) {
        for(j=i+1; j<m; j++) {
            if(vc[i]==vc[j] && (mn[j]>mmx[i])) {
                cnt = vc[i].length()-1;
                mx = max(cnt,mx);
            }
        }
    }
    cout << n-mx << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int M=1e4+10;
typedef long long ll;

int main() {
	char s[110];
	int n;
	cin>>n;
	cin>>s;
	int len=n/2;
	int res=0;
	for(int l=1; l<=len; ++l) {
		int flag=0;
		for(int i=0; i+l<n; ++i) {
			char a[60],b[60];
			for(int j=0; j<l; ++j) {
				a[j]=s[j];
				b[j]=s[j+l];
			}
			int f=strcmp(a,b);
			if(f==0) {
				res=max(res,l);
			}
		}
	}
	if(res)
		--res;
	cout<<n-res<<endl;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cmath>
using namespace std;

const int maxn=100005;
char a[1000005],b[10005];
int n,m;
int nxt[10005];
void getnext(){
    int i,j=0;
    nxt[0]=0;
    nxt[1]=0;
    for(i=1;i<m;i++){
        while(j>0&&b[i]!=b[j])
            j=nxt[j];
        if(b[i]==b[j]) j++;
        nxt[i+1]=j;
    }
}
int dp[maxn];
int main(){
    int t;
    cin>>t;
    while(scanf("%d",&n)!=EOF)
    {

       // for(int i=0;i<=m;i++) dp[i]=m;
        scanf("%s",b);
        m=strlen(b);
        getnext();
        for(int i=0;i<=m;i++) dp[i]=m;
        for(int i=1;i<=m;i++)
        {

            int len=i-nxt[i]-1;
            if(len==0) continue;
            if((nxt[i]+1)%len==0)
            {
                int num=(nxt[i]+1)/len;
                for(int j=1;j<num;j++)
                {
                    if(num%j==0)
                    {
                        dp[i]=min(dp[i],m-i+(num/j)+j*len);
                    }
                }
            }
        }
        int ans=1005;
        for(int i=1;i<=m;i++)
            ans=min(ans,dp[i]);
        cout<<ans<<endl;
    }
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    string s;
    cin>>s;
    int a[n]={0},i=0,m=-1;
    for(int j = 1;j<n;j++){
        if(s[i]==s[j]){
            a[j]=i++;
        }
        else i=0;
    }
    for(int j = n-1;j>-1;j--){
        if((j+1)==(2*(a[j]+1))){
            m=m<a[j]?a[j]:m;
        }
    }
    cout<<(m+1+(n-(2*m)));
}

#include <bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define sz(a) int((a).size())
#define sza(a) (int)(sizeof(a)/sizeof((a)[0]))
#define all(c) (c).begin(),(c).end()
#define clr(x,y) memset(x,(y),sizeof x)
#define ft first
#define sd second
#define ri reverse_iterator
#define pb push_back
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#define rep(i,a,n) for (int i=(a);i<(n);i++)
typedef unsigned long ul;
const int oo = (int) 10e6 + 1;
void solution() {
	int n, ct = 0;
	string s;
	cin >> n >> s;
	string y = "";
	bool f = 1;
	rep(i,0,n)
	{
		y += s[i], ct++;
		if (s.substr(i + 1, sz(y)) == y and f)
			i += sz(y), y += y, ct++,f=false;
	}
	cout << ct;
}
int main() {
	FastIO;
	solution();
	return 0;
}

#include<iostream>
#include<string>
using namespace std;
int main(){
  int n;
  cin>>n;
  string s;
  cin>>s;
  int t=0;
  for(int i=s.size()/2;i>0;i--){
    t=0;

    for(int j=0;j<i;j++){
      if(s[j]==s[j+ i] ){
        if(t==0){
        t=0;
        }
      }else{
        t=1;
      }

    }
    if(t==0){

      cout<<i+(n/i-1) + (n-i*(n/i));
    return 0;
    }
  }

  cout<<n;
  }

/*AUTHOR SAJAL HIT*/
#include<bits/stdc++.h>
#define ll long long int
#define pii pair<ll,ll>
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define M 500005
#define mod 1000000007
#define endl "\n"
#define MAX 100000
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#define w(t)  ll t; cin >> t; while(t--)
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;
int main(){
    SPEED;
    ll n;
    cin>>n;
    ll minm=0;
    minm=n;
    string str;
    cin>>str;
    for(ll i=0;i<=n/2;i++){
    	string lft=str.substr(0,i);
    	ll ln=lft.size();
    	string rght=str.substr(i,i+ln);
    	if(lft==rght){
    		minm=min(minm,n-ln+1);
		}
	}
	cout<<minm<<endl;
}

#include <iostream>
#include <string>
#include <stack>
using namespace std;

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int n;
	cin >> n;
	string name;
	cin >> name;
	int len = name.size();
	stack<string> s;
	for (int i = 0; i < len ; i++){
		string temp = "";
		for (int k = i + 1; k < len; k++){
			for (int j = i; j <= k; j++){
				temp += name[j];
			}
			s.push(temp);
			temp.clear();
		}
	}
	int Max = name.size();
	int len2 = name.size();
	while (!s.empty()){
		int count = 0;
		int k = 0;
		string comp = s.top();
		s.pop();
		int ans = comp.size();
		for (int i = 0; i < len2; i++){
			if (comp[k]== name[i]){
				k++;
				if (k == ans){
					count++;
					k = 0;
				}
			}
			else{
				if (name[i] == comp[0]){
					k = 1;
				}
				else{
					k = 0;
				}
			}
		}
		int dif = 0;
		if (count > 1){
			dif = n - ans + 1;
		}
		else{
			dif = n;
		}
		if (Max > dif){
			Max = dif;
		}
	}
	cout << Max << '\n';

}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    map<string,int>mp;
    int cost,tx;
    tx=cost=s.length();
    for(int i=2; i<s.length(); i++)
    {
        for(int j=0; j<=s.length()-i; j++)
        {

            string t;
            for(int k=j; k<j+i; k++)
            {
                t+=s[k];
            }
            int cnt=0;
            for(size_t xx=s.find(t); xx!=string::npos; xx=s.find(t,xx+t.length()))
                ++cnt;
            cnt--;
            int ty=tx-(t.length()*cnt)+cnt;
            if(ty<cost)
            {
                cost=ty;
            }
        }
    }
    cout<<cost<<endl;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    int n;
    cin>>n;
    string s;
    cin>>s;
    string sp="";
    int cnt=1;
    sp+=s[0];
    for(int i=1;i<s.size();i++){
        int cl=0;
        for(int j=i+1;j<s.size() && cl<sp.size();j++){
            if(s[j]==sp[cl])cl++;
            else break;
        }
        if(cl==sp.size()){
            sp+=sp;
            i+=sp.size();
        }
        cnt++;
    }
    cout<<cnt<<endl;
}

#include <bits/stdc++.h>
#include <cstring>
#define ll long long int
using namespace std;
int main()
{
    ll t,a,b,c,d,i,j,k,l,n,m,x,y;
     string s;
     cin>>n;
     cin>>s;

     k=0;
     l=0;
     for(i=0;i<n;i++){
       l=0;
       for(j=i+1;j<n;j++){
            if(s[j]==s[l]){
             l++;
             k=max(k,l);
                if(l>i)
                   break;
       }
            else{
            if(l>0)
             l=0;
           if(s[j]==s[l])
              l++;
}
      }
}
      a=(n-k)+1;

      if(k==0)
       a=a-1;
      cout<<a;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,count=0,m=0;
	cin>>n;
	string s;
	cin>>s;
	for(int i=0;i<(n)/2;i++)
	{
		if(s.substr(0,i+1)==s.substr(i+1,2*i+1))
		count=i+1;
	}
	if(count==0)
	{
		cout<<n;
		return 0;
	}
	cout<<n-count+1;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

typedef pair<long long int,long long int> pa;
typedef pair<int,int> pi;
#define pb push_back
#define pf push_front
#define mp make_pair
#define f first
#define s second
#define  MAX 500009
#define ll long long int
#define re return 0
long long int MOD=998244353;
long long int mod=1e9+7;
long long int INF=1e18;
ll dx[]={1,-1,0,0};
ll dy[]={0,0,1,-1};

/*
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}
*/

/*
Sieve
int n;
vector<char> is_prime(n+1, true);
is_prime[0] = is_prime[1] = false;
for (int i = 2; i * i <= n; i++) {
    if (is_prime[i]) {
        for (int j = i * i; j <= n; j += i)
            is_prime[j] = false;
    }
}
*/

const int M = 200 * 1000 + 11;

ll gcd(ll a,ll b)
{
	return __gcd(a,b);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	ll t,n,i,l;
	string s;
	cin>>n>>s;
	set<char> r(s.begin(),s.end());
    if(r.size()==1 && n%2==0)
    {
    	cout<<(n/2)+1; re;
	}
	if(r.size()==1 && n%2==1)
    {
    	cout<<(n/2)+2; re;
	}
	ll cnt=0;
	for(i=0;i<(n/2);i++)
	{
		for(l=2;l<=(n/2);l++)
		{
			if(s.substr(i,l)==s.substr(i+l,l))
			{
				cnt=l;
			}
		}
	}
	if(cnt==0)
	{
		cout<<n; re;
	}
	cout<<n-cnt+1;

}

#include<bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	cin>>n;

	string str;
	cin>>str;

	int count=0;
	int i=0;
	int max=-999999;

	while(i<n)
	{
		int ret=0;
		for(int j=i+1;j<2*(i+1);j++)
		{
			if(str[j]==str[ret])
			{
				count++;
				ret++;
			}
		}
		if(count>max && count!=0)
		{
			max=count;
			count=0;
		}
		i++;
	}

	if(max==-999999)
		cout<<n<<endl;
	else
		cout<<n-max+1<<endl;

	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <set>
#include <bitset>
#include <map>
#include<fstream>
int w = 0;
#define  ONGU freopen("groups.in", "r", stdin);
#define  el "\n"
#define  allv(v)      (v).begin(),(v).end()
#define  allvb(v)      (v).rbegin(),(v).rend()
#define  EPS    1e-10
#define  memset       (memo, -1, sizeof memo)
#define  rep(i,x) for(int(i)=0;(i)<(ll)(x);(i)++)
int const oo = (int)10e6;
typedef  long long ll;
using namespace std;
char vowels[] = { 'a', 'o', 'e', 'u', 'i' };
int A[2 * 100000];
ll n, m;
bool cycle = false;
bitset <64> bt;
set <int> st;
vector<bool>comp;
vector<bool>vis;
vector<bool>vis2;
vector<vector<int>>v;
map<int, int>mp;
map<char, int>mp2;
priority_queue<long long, vector<long long>, greater<long long> >pq;
bool viss[100][100] = { 0 };
int l1, l2;
int saved[100][100];
ll savedans[100000] = { 1 };
vector<pair<int, int>>v2;
vector<ll>vc;
vector<ll>va;
char gr[1000][1000];
bool even(ll x)
{
	return ((n & 1) == 0) ? 1 : 0;
}
ll   gcd(ll a, ll b)
{
	return b == 0 ? a : gcd(b, a%b);
}
ll   lcm(ll n, ll m)
{
	return (n*m) / gcd(n, m);
}

string toBinary(int n)
{
	string r;
	while (n != 0) { r = (n % 2 == 0 ? "0" : "1") + r; n /= 2; }
	return r;
}
bool prime(ll n)
{
	if (n == 0 || n == 1)
		return 1;
	for (ll i = 2; i*i <= n; i++)
	if (n%i == 0)
		return 0;
	return 1;
}
bool isvowels(char a)
{
	for (int i = 0; i < 5; i++)
	if (a == vowels[i])
		return true;
	return false;
}
ll binary_search(ll x, ll y)
{
	int l = 0, r = y, mid;
	while (l <= r)
	{
		mid = l + (r - l) / 2;
		if (mid*(mid + 1) == x)
			break;
		else if (mid*(mid + 1) >= x)
			r = mid - 1;
		else
			l = mid + 1;

	}
	if (mid*(mid + 1) == x)
		return mid;
	else
		return -1;
}
bool bal(string z)
{
	string x = z;
	reverse(x.begin(), x.end());
	if (z == x)
		return true;
	else
		return false;
}
void fast(){
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}

bool F(int i, ll sum)
{
	if (i == n)
		return sum%m == 0;
	if (savedans[i] != -1)
		return savedans[i];
	if (F(i + 1, sum + vc[i]) || F(i + 1, sum - vc[i]))
		return 1;
	return 0;

}
int FEB(int n)
{
	if (n <= 1)
		return 1;
	if (savedans[n] != -1)
		return savedans[n];
	return savedans[n] = FEB(n - 1) + FEB(n - 2);

}
int arr1[100005] = { -1 }, arr2[100005] = { -1 };
ll minn;
void Dfs(int u, int p, int c)
{
	if (vis[u])
		return;
	vis[u] = 1;

	for (int i = 0; i < v[u].size(); i++)
	{
		if (!vis[v[u][i]])
			Dfs(v[u][i], u, c);
	}
	return;
}

int find(int u)
{
	if (A[u] == u)
		return u;
	else
		return A[u] = find(A[u]);
}
bool valied(int x, int y)
{
	if (x >= n || y >= m || x < 0 || y < 0)
		return 0;

	return 1;
}

int maxxx(int x, int y)
{
	if (!valied)
		return 0;
	if (saved[x][y] != -1)
		return saved[x][y];
}
string ok = "YES", no = "NO";
map<pair<int, int>, int>mpp;

int bi_s(int x, int f)
{

	int l = 0, r = n - 1, mid;
	if (f != -1)
		l = f + 1;
	while (l <= r)
	{
		mid = l + (r - l) / 2;

		if (f != -1)
		{
			if (vc[mid] - vc[f] > x)
				r = mid - 1;
			else if (vc[mid] - vc[f] < x)
				l = mid + 1;
			else
				break;
		}
		else
		{

			if (vc[mid]  > x)
				r = mid - 1;
			else if (vc[mid]  < x)
				l = mid + 1;
			else
				break;
		}
	}

	return mid;
}
bool anns = false; vector<ll>cost;
ll miiiin = INT_MAX;
void CDfs(int u, int p, int nw)
{

	if (vis2[u])
		return;
	miiiin = min(miiiin, cost[u]);
	vis2[u] = 1;
	for (int i = 0; i < v[u].size(); i++)
	if (v[u][i] != p)
		CDfs(v[u][i], u, nw);
}
bool fff = false;
void fs(int u, int p)
{
	if (vis[u]){
		cycle = true;
		return;
	}
	vis[u] = 1;
	for (int i = 0; i < v[u].size(); i++)
	{
		if (comp[v[u][i]])
			fff = true;
		if (!vis[v[u][i]])
			fs(v[u][i], u);
	}
	comp[u] = true;
}

ll b_search(ll x, ll y, ll z)
{
	ll l = 0, r = z, mid, ans = r;
	while (l <= r)
	{
		mid = l + (r - l) / 2;
		ll xx = (mid / x), yy = (mid / y);
		if (xx + yy >= n){
			r = mid - 1; ans = min(ans, mid);
		}
		else if (xx + yy == n)
			break;
		else
			l = mid + 1;

	}
	return ans;
}

int main()
{
	cin >> n;
	string x; cin >> x;
	string y="";
	for (int i = 0; i < n; i++){
		y += '.';
	}
	ll c = 1, p = 1;
	y[0] = x[0];
	for (int i = 1; i < n; i++)
	{
		bool f = false; int pp = 0;
		for (int j = 0;j <i; j++)
		{
			if (!(x[j] == x[j + i]))
				break;
			if (j == i - 1)
				f = true;
		}
		if (f)
			i *= 2, c++,i--;
		else
			c++;
	}
	cout << c;
//	system("pause");
}

#include<bits/stdc++.h>
using namespace std;
char s[105],sub[10005][105];
int nex[105];
void getnext(char *p)
{
    nex[0]=-1;
    nex[1]=0;
    int j=2,k=0,len=strlen(p);
    while(j<len){
        if(k==-1){
            nex[j]=0;k=0;j++;
            continue;
        }
        else{
            if(p[j-1]==p[k]){
                nex[j]=nex[j-1]+1;
                j++;
                k=nex[j];
            }
            else k=nex[k];
        }
    }
}
int kmp(char *p,char *st)
{
    getnext(p);
    int lenp=strlen(p);
    int lens=strlen(st);
    int i=0,j=0,ant=0;
    while(i<lens){
        while(j<lenp&&i<lens){
            if(j==-1||st[i]==p[j]) i++,j++;
            else j=nex[j];
        }
        if(j==lenp){
            ant++;
            j=0;
        }
    }
    return ant;
}
int main()
{
    int n,cnt=0;
    scanf("%d",&n);
    scanf("%s",s);
    for(int i=0;i<n;i++){
        for(int j=i;j<n;j++){
            int ii=0;
            for(int k=i;k<=j;k++) sub[cnt][ii++]=s[k];
            cnt++;
        }
    }
    int r=200;
    for(int i=0;i<cnt;i++){
        int num=kmp(sub[i],s);
        int len=strlen(sub[i]);
        r=min(r,n-num*len+len+num-1);
    }
    printf("%d\n",r);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    int len;
    cin>>len;
    string s;
    cin>>s;

    int zd = 0;
    bool f = true;
    for(int i = 0; i < len; i++)
    {
        for(int j = i + 2; j < len; j+=2)
        {
            if(j - i % 2 == 0) continue;

            f = true;
            int k = (j - i) / 2 + 1;
            for(int kk = 0; kk <= k; kk++)
            {
                if(s[i + kk] == s[i + kk + k]) continue;
                else
                {
                    f = false;
                    break;
                }
            }
            if(f) zd = max(zd, k);
        }
    }
    //if(zd != 0)
    //cout<<zd<<endl;
    cout<<min(len, len - zd + 1)<<endl;
    //else cout<<len<<endl;
    return 0;
}

#include <bits/stdc++.h>
#define int ll
#define inf 1e9
using namespace std;
typedef long long ll;

main()
{
    int N;
    cin>>N;
    string s;
    cin>>s;
    int MIN = inf;
    for(int i=0;i<=N/2;i++)
    {
        int j=0;
        for(;j<i;j++)
            if(s[j]!=s[j+i]) break;
        if(j==i)
        MIN = N-i;
    }
    cout<<MIN;
}

#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdio.h>
using namespace std;
char t[105];
int tmp=0,len,next[105];
void makenext()
{
    next[0]=-1;
    int k=-1;
    int len=strlen(t);
    for(int i=1;i<len;i++)
    {
        while(k>=0 && t[i]!=t[k+1]) k=next[k];
        if(t[i]==t[k+1]) k++;
        next[i]=k;
        //cout<<i<<" "<<next[i]<<endl;
        if((i&1)&&next[i]>=(i+1)/2-1)tmp=(i+1)/2;
    }
}
int main()
{
    cin>>len;
    scanf("%s",t);
    makenext();
    //cout<<tmp<<endl;
    int ans=min(len-tmp+1,len);
    cout<<ans<<endl;
    //cout << "Hello world!" << endl;
    return 0;
}

#include<stdio.h>
#include<cmath>
#include<stdlib.h>
#include<time.h>
#include<algorithm>
#include<iostream>
#define ll long long
#define qq printf("QAQ\n");
using namespace std;
const int maxn=1e5+5;
const int inf=0x3f3f3f3f;
const double e=exp(1.0);
const double pi=acos(-1);
int main()
{
	int n;
	char a[105];
	while(scanf("%d%s",&n,a)!=EOF)
	{
		int i=2,ans=2;
		/*int dp[105];
		for(int i=0;i<n;i++)dp[i]=inf;
		dp[2]=2;*/
		while(i<n)
		{
			int mi=inf,x=-1,h,k;
			//for(int j=0;j<i;j++)//寻找 和当前一样的
			if(a[i]!=a[0]){i++,ans++;continue;}
			else {
				for( h=0,k=i;h<i;h++,k++)
				{
					if(a[h]!=a[k])break;
				}
				x=max(x,k);
			}
			if(x!=-1)i=x;
			else i++;
			ans++;
		}
		if(n==1)printf("%d\n",n);
		else printf("%d\n",ans);
	}
	return 0;
}

/**
 *    author:  otera
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve() {
	int n; string s; cin >> n >> s;
    set<string> se;
    vector<vector<int>> dp(n + 1, vector<int>(2, inf));
    dp[0][0] = 0;
    for(int i = 0; i < n; ++ i) {
        for(int j = 0; j < i; ++ j) {
            se.insert(s.substr(j, i - j));
        }
        rep(k, 2) chmin(dp[i + 1][k], dp[i][k] + 1);
        for(int j = i + 1; j <= n; ++ j) {
            if(se.find(s.substr(i, j - i)) != se.end()) {
                chmin(dp[j][1], dp[i][0] + 1);
            }
        }
    }
    cout << min(dp[n][0], dp[n][1]) << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <map>
using namespace std;
#define lon long long
int main()
{
    int n, i, j, cnt=0,mx=0;
    string s;
    vector <string> vc;
    vector <int> mn, mmx;
    cin >> n;
    cin >> s;
    int m = n;
    while(m>1) {
        for(i=0; i+m <=n; i++) {
            string ss;
            for(j=i; j<i+m; j++) ss+=s[j];
            vc.push_back(ss);
            mn.push_back(i);
            mmx.push_back(i+m-1);
        }
        m--;
    }
    m = vc.size();
    for(i=0; i<m; i++) {

        for(j=0; j<m; j++) {
            if(vc[i]==vc[j] && (mn[j]>mmx[i]||mn[i]>mmx[j]) && i!=j) {
                cnt = vc[i].length()-1;
                mx = max(cnt,mx);
            }
        }
    }
    cout << n-mx << endl;
    return 0;
}

    //Aim --> Blue on CF ....

    /*          IT IS GOING TO HAPPEN !
                    because
                     I AM GOING TO MAKE IT HAPPEN !      */

    // " every champion was once a contender who refused to give up " //
    // never give up !
    // vectorTango
    // reapedJuggler

    #include "bits/stdc++.h"

    #define DIEHOD ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
    #define ld long double
    #define ll long long
    #define all(A) begin(A) , end(A)
    #define sf(x)  scanf("%d",&x)
    #define sfl(x) scanf("%lld",&x)
    #define pf(x)  printf("%d\n",x)
    #define pfl(x) printf("%lld\n",x)
    #define pii    pair<lld , lld>
    #define rep(i , a , b)  for(lld i = a; i < b ; i++)
    #define reps(i , a , b) for(lld i = a ; i >= b ; i--)
    #define ftc(x)  cerr << #x << ": " << x << " \n" ;
    #define vvi   vector < pair <lld , lld> >
    #define lcm(a,b) ((a*b)/__gcd(a,b))
    #define lld long long int
    #define ulld unsigned long long int
    #define input lld* arr = new lld [n]
    #define input1 lld* brr = new lld [n]
    #define vec vector < lld >
    #define pb push_back
    #define ss second
    #define ff first
    #define inf (lld)(1e18)
    #define fin -999999999999999999
    #define mod 1000000007
    #define umap unordered_map
    #define mpp make_pair
    #define finish(x) cout << x << " ";
    #define tolower(s)   std::transform(s.begin(), s.end(), s.begin(),[](unsigned char c){ return std::tolower(c); });

    using namespace std;

  //   map <lld , vector<lld>> g;
  //   vec v;
  //   map<lld , bool> vis ; lld siz = 0 , ans = 0 ;

  //    void dfs(lld x){

  //    vis[x] = 1;

  //    for(auto i : g[x]){
  //     if(!vis[i]){
  //       dfs(i);
  //     }
  //    }

  //    return;
  //   }

  // lld pow1(ulld  a , ulld y){
  //   a %= mod;
  //   ulld  res = 1;

  //   while(y > 0){

  //     if(y & 1)
  //       res = (res*a)%mod;

  //     y = y >> 1;
  //     a = (a*a)%mod;
  //   }
  //   return res;
  // }

  // lld power(lld a , lld b){
  //   ulld res = 1;
  //   while(b){
  //      if(b & 1)
  //        res = res*a;

  //      b = b >> 1;
  //      a = a * a;
  //   }
  //   return res;
  // }

  // bool isPrime(lld n){
  //   if (n <= 1)  return false;
  //     if (n <= 3)  return true;
  //     if (n % 2 == 0 || n%3 == 0) return false;

  //       lld p = sqrt(n);

  //       for(lld i=5;i <= p ; i = i + 6)
  //         if (n % i == 0 || n % (i + 2) == 0)
  //           return false;
  //       return true;
  // }

  // bool sortbysec(const pair<lld ,lld > &a, const pair<lld ,lld > &b) {
  //   return (a.ss < b.ss);
  // }

void sober(){
lld n , x = 0 , a = 0 , b = 0 , y = 0 , sum = 0 , k = 0 , m = 0;
cin >> n;
string s;
cin >> s;
string lf = "";
lld ans = 1;
lf = lf + s[0];
k = 1;
//  abc , abc , abcabc

// cout << lf << "  " << k << "\n";

while(k < n and s[k] != lf[0]){
  lf = lf + s[k];
  k++;
  ans++;
}
string zz = lf;
// cout << lf << "  " << k << "\n";

for(int i = k ; i < n ; i++){

  if(i + lf.length() <= n and s.substr(i , (int)lf.length()) == lf){
      i += lf.length() - 1;
      zz = lf;
      lf = lf + lf ;
      // ans++;
  }

  else{
    // ans++;
    lf = lf + s[i];
  }
  // cout << ans << " " << i << "\n";
}

// cout << zz << "\n";
bool foo = 0;
ans = 0;
for(int i = 0 ; i < n ; i++){

  if(i + zz.length() <= n and s.substr(i , (int)zz.length()) == zz and !foo){
      // cout << i << "  " << "\n";
      i += zz.length() - 1;
      foo = 1;
      ans++;
  }

  else{
    ans++;
    // lf = lf + s[i];
  }
  // cout << ans << " " << i << "\n";
}

cout << ans << "\n";

}

signed main(){

  #ifndef ONLINE_JUDGE
      freopen("input.txt" , "r" , stdin) ;
      freopen("output.txt" , "w" , stdout) ;
  #endif

  DIEHOD;
  lld t = 1;
  // cin >> t;
  while(t--){
     sober();
  }
}

//  c0ded by :
// - - - - - - - - - - - - - - - - - - - - - - s 0 b e r and s i m r a n

#include<bits/stdc++.h>
using namespace std;
typedef long  long ll;
const ll mod = 1000000007, ar = 100005;
#define  pi 3.1415926535897932384626433832795
#define hello ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main() {
    hello
    string s,z=""; cin >>s >> s;
    vector<pair<string,int >  > vec;
    for(int w = 0 ;w < s.size(); w++) {
        if(s[w] == s[0]) {
        string k = s.substr(w,w);
            vec.push_back({k,w});
        }
    }
   int mx = 0 ;
    for(int w = 0 ;w < s.size(); w++) {
        z+=s[w];
    for(int i = 0 ; i< vec.size(); i++) {
        if(vec[i].first == z && i+1 == vec[i].second) mx = max(mx,(int)vec[i].first.size());
        }
    }

    cout << min (s.size(),s.size()-(mx)+1) << endl;

    return 0 ;
}

#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef long double ld;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb(a) push_back(a)
#define sz(a) (int)a.size()
#define mp(a, b) make_pair(a, b)
#define out1(a) cout<<a<<endl
#define out2(a, b) cout<<a<<" "<<b<<endl
#define out3(a, b, c) cout<<a<<" "<<b<<" "<<c<<endl
#define out4(a, b, c, d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl
#define out5(a, b, c, d, e)   cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl

// #include <bits/stdc++.h>
// using namespace std;

int main(){
	int n;
	cin>>n;
	string s;
	cin>>s;
	int i=0;
	int flag=0;
	int len = INT_MIN;
	for (int j = 1; j <n; ++j)
	{
		if(s[i]==s[j] && j<n-1){
			// int t = j-i+1;
			// cout<<i<<endl;
			if(i+1>len) len = i+1;
			i++;
			flag = 1;
		}
		else {
			i=0;
		}
	}
	// cout<<len<<endl;
	if(flag==1)cout<<n-len+1<<endl;
	else cout<<n<<endl;
}

#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int dp[N], n, a;
string s;
bool C(int r){
    if(r%2==0) return(0);
    int q = (r+1)/2;
    for(int i=0;q<(int)s.size();i++, q++){
        if(s[q]!=s[i]) return(0);
    }
    return(1);
}
int main(){
    cin >> n >> s;
    dp[0] = 1;
    for(int i=1;i<n;i++){
        if(C(i)) dp[i] = dp[i/2]+1;
        else dp[i] = dp[i-1]+1;
    }
    cout << dp[n-1];
}

//
//  main.cpp
//  nik string typing
//
//  Created by PREEYADARSHEE DEV on 01/04/18.
//  Copyright © 2018 PREEYADARSHEE DEV. All rights reserved.
//

#include <iostream>
int main()
{
    int n;
    scanf("%d",&n);
    char a[n+1];
    scanf("%s",a);
    int count=0;
    if(n%2==0)
    {
        for(int i=0;i<n/2;i++)
        {
            if(a[i]!=a[n/2+i])
            {
                count=count+1;
                break;
            }
        }
        if(count==0)
        {
            printf("%d\n",n/2+1);
        }
        else
        {
            printf("%d\n",n);
        }
    }
    else
    {
        for(int i=0;i<n/2;i++)
        {
            if(a[i]!=a[n/2+i])
            {
                count=count+1;
                break;
            }
        }
        if(n!=1)
        {
        if(count==0)
        {
            printf("%d\n",n/2+2);
        }
        else
        {
            printf("%d\n",n);
        }
        }
        else
        {
            printf("%d\n",1);
        }

    }
}

// http://codeforces.com/contest/954/problem/B
#include <iostream>

using namespace std;

int main() {
	int n;
	string s;
	cin >> n >> s;
	int l = n / 2;
	int m = 1;
	for (int i = l; i >= 2; i--) {
		for (int j = 0; j <= n - i * 2; j++) {
			bool ok = true;
			for (int z = 0; z < i; z++) {
				if (s[j + z] != s[j + i + z]) {
					ok = false;
					break;
				}
			}
			if (ok) {
				cout << n - i + 1 << endl;
				return 0;
			}
		}
	}
	cout << n - m + 1 << endl;
}

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pii pair<int,int>
#define pll pair<lli, lli>
#define vi  vector<int>
#define vii vector<pair<int,int>>
#define vll vector<lli>
#define pb  push_back
#define mpr  make_pair
#define ss  second
#define ff first
#define INF 1000000001
#define inf1 1000000000000000001
#define pie 3.14159265358979323846264338327950L
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define testcase() int tc;cin>>tc;while(tc--)
#define clean(x) memset(x,0,sizeof(x))
const lli maxn = 300000+5;
const lli mod= 1000000007;
vector<lli> catlan(int n) {
    vector<lli> dp(n + 1, 0);
    dp[0] = 1;
    dp[1] = 1;
    for (int i = 2; i <= n; i ++) {
        for (int j = 0; j < i; ++ j) {
            dp[i] += dp[j] * dp[i - j - 1];
        }
    }
    return dp;
}
lli digit(lli n){int res=(int)log10(n)+1;return res;}
lli lcm(lli a,lli b){lli ans=(a*b)/(__gcd(a,b));return ans;}
lli b_ex(lli n,lli a){lli res=1;while(n){if(n%2==1)res*=a;n>>=1;a=a*a;}return res;}
lli ncr(lli n,lli k){lli ans=1;if(k>n-k)k=n-k;for(lli i=1;i<=k;i++){ans*=(n-i+1),ans=ans/i;}return ans;}
lli power(lli a , lli n){lli ans = 1;while(n){if(n % 2)ans = (ans * a) % mod;n /= 2;a = (a * a) % mod;}return ans;}
lli set_bits(lli n)
{
    int c=0;
    if(n==0)return 0;
    while(n)
    {
        if((n&1)==1)
        {
           cout<<c<<" ";
        }
        c++;
        n=n>>1;
    }
    return c;
}

lli inf = 5e17;
///=================== ALWAYS CHECK 1 or 0 base case=================================================================================///
///------------------ALWAYS lli-----TEMP TSF99--------------------------------------------------------------------------------------//

void solve()
{
    int n;cin>>n;
    string a;cin>>a;
    int d=0;
    int ans=INT_MAX;
    for(int i=0;i<n;i++)
    {
        int k=0;
        int d=0;
        bool f=false;
        for(int j=i+1;j<n and k<=i;j++)
        {
            if(a[k++]==a[j])
            {
                f=true;
                d++;
            }
            else break;
        }
        if(!f)continue;
        ans=min(ans,d+1+(n-2*d));

    }
    if(ans==INT_MAX)ans=n;
    cout<<ans<<endl;

}
int main()
{
    solve();
}

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int cnt  = 1;
    string str;
    str = "";
    string okay;
    okay = "";
    int m = 0;
    bool flag = false;

    double n;
    cin >>n;
    string a;
    cin >> a;
    set<char>st;
    str+=a[0];
    st.insert(a[0]);
    for(int i = 1 ; i<n; i++)
    {
        st.insert(a[i]);
        if(a[i] == str[m])
        {
            m++;
            flag = true;
            okay += a[i];
            if(m == str.size())
            {
                cnt++;
                m  = 0;
                okay = "";
            }
        }
        else
        {
            if(!flag)
            {
                str += a[i];
            }
            else
            {
                str+=okay;
                okay = "";
                flag = false;
                str += a[i];
            }
            m = 0;
        }
    //    cout << str << endl;
    }
   // cout << str.size() << " " << str << endl;
    //if(cnt % 2 == 0)
    //{
    if(st.size() == 1)
    {
        cout << ceil(n/2) + 1 << endl;
    }
    else if(st.size() == n)
    {
        cout << n << endl;
    }
    else if(cnt%2==0){
        cout << str.size()  + (cnt/2) + okay.size() << endl;
    }
    else
    {
        cout << ((str.size()) * (cnt/2)) + (cnt/2) + str.size() - 1 + okay.size() << endl;
    }

}
/**
16
abcabcabcabcabca
**/

#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <cmath>

using namespace std;

int n,ans = 1;

string s;

int main()
{
	cin >> n >> s;
	for (int i = 0;i < s.size();i++)
		for (int j = i,l = j + j - i;l < s.size();j++,l += 2)
				if (s.substr(i,j - i + 1) == s.substr(j,l - j + 1))
					ans = max(ans,j - i + 1);
	cout << n - ans + 1 << endl;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;
 int n;
    string s;
int main()
{

    cin>>n>>s;
    int k=0;
    for(int i=1;i+i<=n;i++)
    if(s.substr(0,i)==s.substr(i,i)){
            k=n-i+1;
    }
    cout<<k<<endl;
    return 0;
}

#include<iostream>
#include<string>
using namespace std;

int main()
{
	int i,j,k,l,m,n,now;
	string s;
	while(cin>>n)
	{
		cin>>s;

		//l=s.size();

		int z[109]={0};
		//z[0]=-1;
		for(i=1;i<n;i++)
		{
			k=0;
			now=-1;
			for(j=i;j<n;j++)
			{
				//cout<<s[j]<<" "<<s[now+1]<<endl;
				if(now<i-1 && s[j]==s[now+1])
				{
					now++;
					k++;
					z[i]++;
					continue;
				}
				else
				{
					//z[i]=k;
					break;
				}
			}
		}

		int ans=0;
		//cout<<"saif\n";
		for(i=0;i<n;)
		{
			if(z[i]==0)
			{
				ans++;
				i++;
			}
			else
			{
				ans++;
				i+=z[i];
			}
		}

		cout<<ans;
		cout<<endl;
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

typedef pair<long long int,long long int> pa;
typedef pair<int,int> pi;
#define pb push_back
#define pf push_front
#define mp make_pair
#define f first
#define s second
#define  MAX 500009
#define ll long long int
#define re return 0
long long int MOD=998244353;
long long int mod=1e9+7;
long long int INF=1e18;
ll dx[]={1,-1,0,0};
ll dy[]={0,0,1,-1};

/*
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}
*/

/*
Sieve
int n;
vector<char> is_prime(n+1, true);
is_prime[0] = is_prime[1] = false;
for (int i = 2; i * i <= n; i++) {
    if (is_prime[i]) {
        for (int j = i * i; j <= n; j += i)
            is_prime[j] = false;
    }
}
*/

const int M = 200 * 1000 + 11;

ll gcd(ll a,ll b)
{
	return __gcd(a,b);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	ll t,n,i,l;
	string s;
	cin>>n>>s;
	set<char> r(s.begin(),s.end());
    if(r.size()==1 && n%2==0)
    {
    	cout<<(n/2)+1; re;
	}
	if(r.size()==1 && n%2==1)
    {
    	cout<<(n/2)+2; re;
	}
	ll cnt=0;

		for(l=2;l<=(n/2);l++)
		{
			if(s.substr(0,l)==s.substr(0+l,l))
			{
				cnt=l;
			}
		}

	if(cnt==0)
	{
		cout<<n; re;
	}
	cout<<n-cnt+1;

}

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
	string s;
	int n, ans = 0;
	cin >> n >> s;
	for (int i = 1; i < n; i++)
	{
		if (s[0] == s[i])
		{
			int j = 1, k = 1;
			for (int u = i + 1; u < n && j < i; u++)
			{
				if (s[u] == s[j++])
					k++;
				else
					break;
			}
			if (j == i)
				ans = max(ans, k);
		}
	}
	cout << min(ans + (n - ans * 2) + 1, n);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define lli long long int
#define db double
#define ll long long
#define ld long double
#define li long int
#define pb push_back
#define mp make_pair
#define FOR(i,a,b) for(i=a;i<b;i++)
#define RFOR(i,a,b) for(i=a;i>b;i--)
#define f first
#define s second
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));
#define mod 1000000007
#define pl pair<ll,ll>
#define pll pair<ll,pl>
#define all(a) a.begin(),a.end()
#define nl cout<<endl
#define inf LONG_LONG_MAX
#define minf LONG_LONG_MIN
#define pq priority_queue

bool isPrime(ll n)
{

        if (n <= 1)  return false;
        if (n <= 3)  return true;

        if (n%2 == 0 || n%3 == 0)
            return false;

        for (ll i=5; i*i<=n; i=i+6)
        {
            if (n%i == 0 || n%(i+2) == 0)
               return false;
        }

        return true;
}
ll po(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
bool sec(const pl &a,const pl &b)
{
    if(a.s==b.s)
        return a.f>b.f;
    return a.s>b.s;
}

int main()
{
    fast;
    ll n,i,j,k,f=0;
    string s;
    cin>>n>>s;
    if(n<4)
    {
        cout<<"4";
        return 0;
    }
    RFOR(k,n/2,1)
    {
        FOR(i,0,n-2*k+1)
        {
            f=0;
            FOR(j,i,i+k)
            {
                if(s[i]!=s[i+k])
                {
                    f=1;
                    break;
                }
            }
            if(!f)
            {
                cout<<n-k+1;
                return 0;
            }
        }
    }
    cout<<n;
}

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

map<string,int>m;
int main()
{
int n,c=0;
cin>>n;
string s,t="77";
cin>>s;
vector<string>v;
for(int i=0;i<s.size();i++)
{
    for(int j=i;j<(s.size());j++)
    {
        string g=s.substr(i,j);
        //cout<<g<<endl;
        if(g!=t){
        m[g]++;t=g;
        }
    }
}
for(auto i:m)
{
string h=i.first;
//cout<<h<<" "<<i.second<<endl;;
if(i.second>1)
{
v.push_back(h);
}
}
int r=0;
for(int i=0;i<v.size();i++)
{
    int w =v[i].size();
   int p=s.find(v[i]),c=0;
    while(p>=0&&p<s.size())
    {
         c++;
         int ee=p;
       //  cout<<v[i]<<" "<<p<<endl;
         p=s.find(v[i],p+v[i].size());
         if(p==ee+v[i].size()){c++;break;}
         else {c=0;break;}
    }
    if(c>=2)
    r=max(r,w);
}
cout<<n-((r>0)?r-1:0);

    return 0;
}

      //Aim --> Blue on CF ....

      /*          IT IS GOING TO HAPPEN !
                      because
                       I AM GOING TO MAKE IT HAPPEN !      */

      // " every champion was once a contender who refused to give up " //
      // never give up !
      // vectorTango
      // reapedJuggler

      #include "bits/stdc++.h"

      #define DIEHOD ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
      #define ld long double
      #define ll long long
      #define all(A) begin(A) , end(A)
      #define sf(x)  scanf("%d",&x)
      #define sfl(x) scanf("%lld",&x)
      #define pf(x)  printf("%d\n",x)
      #define pfl(x) printf("%lld\n",x)
      #define pii    pair<lld , lld>
      #define rep(i , a , b)  for(lld i = a; i < b ; i++)
      #define reps(i , a , b) for(lld i = a ; i >= b ; i--)
      #define ftc(x)  cerr << #x << ": " << x << " \n" ;
      #define vvi   vector < pair <lld , lld> >
      #define lcm(a,b) ((a*b)/__gcd(a,b))
      #define lld long long int
      #define ulld unsigned long long int
      #define input lld* arr = new lld [n]
      #define input1 lld* brr = new lld [n]
      #define vec vector < lld >
      #define pb push_back
      #define ss second
      #define ff first
      #define inf (lld)(1e18)
      #define fin -999999999999999999
      #define mod 1000000007
      #define umap unordered_map
      #define mpp make_pair
      #define finish(x) cout << x << " ";
      #define tolower(s)   std::transform(s.begin(), s.end(), s.begin(),[](unsigned char c){ return std::tolower(c); });

      using namespace std;

    //   map <lld , vector<lld>> g;
    //   vec v;
    //   map<lld , bool> vis ; lld siz = 0 , ans = 0 ;

    //    void dfs(lld x){

    //    vis[x] = 1;

    //    for(auto i : g[x]){
    //     if(!vis[i]){
    //       dfs(i);
    //     }
    //    }

    //    return;
    //   }

    // lld pow1(ulld  a , ulld y){
    //   a %= mod;
    //   ulld  res = 1;

    //   while(y > 0){

    //     if(y & 1)
    //       res = (res*a)%mod;

    //     y = y >> 1;
    //     a = (a*a)%mod;
    //   }
    //   return res;
    // }

    // lld power(lld a , lld b){
    //   ulld res = 1;
    //   while(b){
    //      if(b & 1)
    //        res = res*a;

    //      b = b >> 1;
    //      a = a * a;
    //   }
    //   return res;
    // }

    // bool isPrime(lld n){
    //   if (n <= 1)  return false;
    //     if (n <= 3)  return true;
    //     if (n % 2 == 0 || n%3 == 0) return false;

    //       lld p = sqrt(n);

    //       for(lld i=5;i <= p ; i = i + 6)
    //         if (n % i == 0 || n % (i + 2) == 0)
    //           return false;
    //       return true;
    // }

    // bool sortbysec(const pair<lld ,lld > &a, const pair<lld ,lld > &b) {
    //   return (a.ss < b.ss);
    // }

  void sober(){
  lld n , x = 0 , a = 0 , b = 0 , y = 0 , sum = 0 , k = 0 , m = 0;
  cin >> n;
  string s;
  cin >> s;
  string lf = "";
  lld ans = 1;
  lf = lf + s[0];
  k = 1;
  //  abc , abc , abcabc

  // cout << lf << "  " << k << "\n";

  while(k < n and s[k] != lf[0]){
    lf = lf + s[k];
    k++;
    ans++;
  }
  string zz = "";
  // cout << lf << "  " << k << "\n";

  for(int i = k ; i < n ; i++){

    if(i + lf.length() <= n and s.substr(i , (int)lf.length()) == lf){
        i += lf.length() - 1;
        zz = lf;
        lf = lf + lf ;
        // ans++;
    }

    else{
      // ans++;
      lf = lf + s[i];
    }
    // cout << ans << " " << i << "\n";
  }

  // cout << zz << "  " << lf << "\n";

  if(zz.length() >= 2){
    zz = lf.substr(0 , lf.length() / 2);
  }

  bool foo = 0;
  ans = 0;
  for(int i = 0 ; i < n ; i++){

    if(i + zz.length() <= n and s.substr(i , (int)zz.length()) == zz and !foo and zz.length() >= 2){
        // cout << i << "  " << "\n";
        i += zz.length() - 1;
        foo = 1;
        ans++;
    }

    else{
      ans++;
      // lf = lf + s[i];
    }
    // cout << ans << " " << i << "\n";
  }

  cout << ans << "\n";

  }

  signed main(){

    #ifndef ONLINE_JUDGE
        freopen("input.txt" , "r" , stdin) ;
        freopen("output.txt" , "w" , stdout) ;
    #endif

    DIEHOD;
    lld t = 1;
    // cin >> t;
    while(t--){
       sober();
    }
  }

  //  c0ded by :
  // - - - - - - - - - - - - - - - - - - - - - - s 0 b e r and s i m r a n

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    int n;
    cin>>n;
    string s;
    cin>>s;
    string sp="";
    int cnt=1;
    sp+=s[0];
    for(int i=1;i<s.size();i++){
        int cl=0;
        for(int j=i;j<s.size() && cl<sp.size();j++){
            if(s[j]==sp[cl])cl++;
            else break;
        }
        if(cl==sp.size()){
            sp+=sp;
            i+=sp.size();
        }else sp+=s[i];
        cnt++;
    }
    cout<<cnt<<endl;
}

#include<bits/stdc++.h>
using namespace std;

int main() {

    int n;
    cin >> n;
    string s;
    cin >> s;

    int window = n / 2;
    int res = 0;
    for(int w = 1; w <= window; w++) {

        for(int i=0; i < n; i++) {

            if(i + (2 * w) < n) {
                bool matches = true;
                for(int j=i; j < i + w; j++) {
                    if(s[j] != s[j+w] || s[j] == '-' || s[j+w] == '-') {
                        matches = false;
                        break;
                    }
                }
                if(matches){
                    for(int j=i; j < i + (2 * w); j++) {
                        s[j] = '-';
                    }
                    res += w + 1;
                }
            }
        }
    }

    for(int i=0; i < n; i++) {
        if(s[i] == '-') {
            continue;
        }
        res++;
    }

    cout << res << "\n";

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int M=1e4+10;
typedef long long ll;

int main() {
	char s[110];
	int n;
	cin>>n;
	cin>>s;
	int len=n/2;
	int res=0;
	for(int l=1; l<=len; ++l) {
		int flag=0;
		for(int i=0; i+l<n; ++i) {
			char a[60],b[60];
			for(int j=0; j<l; ++j) {
				a[j]=s[j];
				b[j]=s[j+l];
			}
			int f=strcmp(a,b);
			if(f==0) {
				res=max(res,l);
			}
		}
	}
	if(res)
		--res;
	cout<<n-res<<endl;
}

//
//  main.cpp
//  nik string typing
//
//  Created by PREEYADARSHEE DEV on 01/04/18.
//  Copyright © 2018 PREEYADARSHEE DEV. All rights reserved.
//

#include <iostream>
#include <string.h>
int main()
{
    int n;
    scanf("%d",&n);
    char a[n+1],pd[n+1],nik[n+1];
    scanf("%s",a);
    int count=0,temp=n;
    for(int i=1;i<n;i++)
    {
        if(a[0]==a[i])
        {
            for(int j=0;j<i;j++)
            {
                pd[j]=0;
                nik[j]=0;
                pd[j]=a[j];
                nik[j]=a[j+i];
            }
            if(strcmp(pd,nik)==0)
            {
                count=1;
                temp=n-i;
            }
        }
    }
    printf("%d\n",temp+count);
}

#include <iostream>

using namespace std;

int main()
{
    int n,m=0;
    string s ;
    cin>>n>>s ;
    for (int i=0 ; i<n-1;i++)
    {

        for (int j=i+1; j<n; j++)
        {
            int c=0;
            if (s[j]==s[i])

            while((s[i+c]==s[j+c])&&(i+c<j))
                c++;
            if (c>m)
            m=c ;

        }

    }

    cout<<min(n-m+1,n) ;
}

#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
char a[1000000];
int l,s,sum;
int main()
{
//    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    while(scanf("%d",&l)==1)
    {
        sum=0;
        scanf("%s",a+1);
        for(int i=1;i<=l;i++)
        {
            for(int j=0;j<=l/2;j++)
            {
                if(a[i+j]==a[j])
                {
                    sum=max(sum,j);
                }
            }
        }
        if(!sum)cout<<l<<endl;
        else
        cout<<l-sum+1<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
void setIO(string name = "1103A") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    freopen((name+".in").c_str(), "r", stdin);
    freopen((name+".out").c_str(), "w", stdout);
}

int main() {
    //setIO();
    int n; string str; cin >> n >> str;
    bool ok = 0; int l;
    for (int i = 100; i > 1; i--) {
        for (int j = 0; j < n; j++) {
            for (int k = j + i; k < n - i; k++) {
                if (str.substr(j, i) == str.substr(k, i)) {
                    ok = 1;
                    l = i;
                    break;
                }
            }
            if (ok) {
                break;
            }
        }
        if (ok) {
            break;
        }
    }
    if (ok) {
        cout << n - l + 1 << "\n";
    } else {
        cout << n << "\n";
    }
}

#include <iostream>
#include <cmath>
#include <string>
using namespace std;

int main()
{
    int n; //number of steps
    cin>>n;
    int a[n]; //sequence of numbers
    int y=0;
    int x=0;
    long long k; //difference
    cin>>a[0];
    for(int i=1; i<n;i++)
    {
        cin>>a[i];
        k= abs(a[i]-a[i-1]);
        if(k==0)
        {
            cout<<"NO"<<endl;
            return 0;
        }
        else if(k >1)
        {
            if(y==0)
            {
                y=k;
            }
            else if(k!=y)
            {
                cout<<"NO"<<endl;
                return 0;
            }
        }
    }
    cout<<"YES"<<endl;

    if(y==0)
    {
        cout<<1000000000<<" "<<1000000000<<endl;
    }

    if(y>1)
    {
        cout<<1000000000<<" "<<y<<endl;
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;

int n, m, r, p;
string s;

int main()
{
	cin>> n >> s;
	p = n;

	for(r = 1 ; r < n ; r ++)
	{
		m = r + 1;

		//cout<< s.substr(0, m) << " " << s.substr(r + 1, m) << "\n";

		if(s.substr(0, m) == s.substr(r + 1, m))
		{
			p -= (m - 1);
			r += m - 1;

			//cout<< "100\n";

		}

	}
	cout<< p;

}

#include<cstdio>
#include<cstring>
using namespace std;
char s[200];
int ne[200];
void fail(int n)
{
	int i=0,j=-1;
	ne[0]=-1;
	while(i<n)
	{
		if(j==-1||s[i]==s[j])
		{
			i++;
			j++;
			ne[i]=j;
		}
		else
			j=ne[j];
	}
}
int main()
{
	int n;
	scanf("%d",&n);
	scanf("%s",s);
	fail(n);
	int xhj=n-1-ne[n-1];
	if(xhj==n-1)
		printf("%d\n",n);
	else
	{
		if(n%xhj==0)
		{
			if((n/xhj)%2==0)
				printf("%d\n",n/2+1);
			else
				printf("%d\n",n/2+1+xhj);
		}
		else
		{
			int k=n%xhj;
			if(((n-k)/xhj)%2==0)
				printf("%d\n",n/2+1+k);
			else
				printf("%d\n",n/2+1+xhj+k);
		}
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int n,ma=1;
    cin>>n;
    string a;
    cin>>a;
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j-i+1<=n-j-1;j++)
        {
            bool per=true;
            for(int z=j+1;z<j+(j-i)+1;z++)
            {
                if(a[z]!=a[z-(j-i)-1])per=false;
            }
            if(per)ma=max(j-i+1,ma);
        }
    }
    cout<<n-ma+1;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    scanf("%d\n",&n);
    char c[105];
    scanf("%s",c);
    int num=0,maxn=0;
    int s1,s2;
    int nums[150];
    memset(nums,0,sizeof(nums));
    int flag=1;
    for(int a = 0; a < strlen(c); a ++)
        nums[c[a]]++;
    for(int a = 0; a < 150; a ++)
    {
        if(nums[a]>1)
        {
            flag=0;
            break;
        }
    }
    if(flag)
    {
        printf("%d",strlen(c));
        return 0;
    }
    for(int a = strlen(c)/2+1; a >= 0; a --)
    {
        for(int b = 0; b < strlen(c)-a; b ++)
        {
            flag=0;
            for(int d = b; d < a; d ++)
            {
                if(c[d]!=c[d+a])
                {
                    flag=1;
                    break;
                }
            }
            if(!flag)
                break;
        }
        if(!flag)
        {
            num=strlen(c)-a+1;
            break;
        }
    }
    printf("%d",num);
    return 0;
}

#include<cstdio>
#include<cstring>
using namespace std;
char s[200];
int ne[200];
void fail(int n)
{
	int i=0,j=-1;
	ne[0]=-1;
	while(i<n)
	{
		if(j==-1||s[i]==s[j])
		{
			i++;
			j++;
			ne[i]=j;
		}
		else
			j=ne[j];
	}
}
int main()
{
	int n;
	scanf("%d",&n);
	scanf("%s",s);
	fail(n);
	int ans=n,f=0,xhj=0,yj=0;
	for(int i=1;i<=n;i++)
	{
		if(ne[i]==0&&f==0)
			xhj++;
		if(ne[i]!=0)
			f=1;
		if(ne[i]==0&&f==1)
			yj=i;
	}
	if(yj==0&&f!=0)
	{
		ans-=(n-1)/xhj/2*xhj-1;
	}
	else if(f==0)
		ans=n;
	else
	    ans-=(yj-1)/xhj/2*xhj-1;
	printf("%d\n",ans);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,d=0,e=0;
	cin>>a;
	string b;
	cin>>b;
	int c;
	c=a;
	while(c!=1){
		if(c%2==0){
			for(int i=0;i<b.size();i++){
				for(int j=i;j<i+(c/2);j++){
					if(b[j]!=b[i+(c/2)+d]){
						e=1;
						break;
					}
					d++;
				}
				d=0;
			if(e==0){
				cout<<a-(c/2)+1;
				return 0;
			}
			e=0;
		}
	}
	c--;
	}
	cout<<a;
}

// Created by SAMAN on ۳/۱۳/۲۰۲۰ م..
//freopen(filename,read)
#include <iostream>
#include <algorithm>
#include <map>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <iterator>
#include <cmath>
#include <ctime>
#include <iomanip>
#define lint long long int
#define kill(x) return cout<<x<<'\n', 0;
#define debug(x) cout << #x << " : " << x << '\n'

using namespace std;
const int maxn = 1e6+7;
lint argc [maxn];
lint dp [maxn];
int n,cnt,ans,mini,x,t,z,f,y,se,p;
string s;
string sm[107];
string m[107];
int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    cin >> n >> s;
    m[0] =s[0];
    for(int i = 1;i <= n/2 + 5;i++){

        sm[i-1] = m[i-1] + m[i-1];
        m[i]= m[i-1] + s[i];
    }
    for(int i = n/2+1;i>0;i--){
      // cout<<sm[i] <<"  "<<m[2*i]<<endl;
        if(sm[i-1] == m[2*i-1]){
          //  cout<<"akbar"<<endl;
            cnt = i;
            f = 1;
            break;
        }
    }
    cnt -= f;
  /*  for(int i = 0;i < n;i++){
        debug(i);
        debug(m[i]);
        debug(sm[i]);
    }
    */
    cout<<n-cnt<<endl;
}

//Author :: Shiv Prakash Sharma
//Work Hard And Prove Yourself

#include<bits/stdc++.h>

#define rep(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
#define ll long long int
#define mod 1000000007
#define endl "\n"
#define blank " "

using namespace std;

ll power(ll a, ll p){ll ret = 1;while(p > 0){if(p & 1){ret *= a;}a *= a;p >>= 1;}return ret;}

ll powmod(ll a,ll b,ll MOD) {if(b==0)return 1;ll x = powmod(a,b/2,MOD);ll y = (x*x) % MOD;if(b%2)return (a*y) % MOD;return y % MOD;}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin >> n;
    string s;
    cin >> s;
    int ans = 1000000;
    for(int i=0;i<n;i++)
    {
        //cout << endl;
        string a = "";

        for(int j=i;j<n;j++)
        {
            a = a + s[j];
            //cout << a << "\t";
            int size = j-i+1;
            int index = 0;
            int f = 0;
            for(int k=j+1;k<=j+size && k<n;k++)
            {
                f = 2;
                if(a[index] != s[k])
                {
                    f = 1;
                    break;
                }
                index++;
            }
            if(f==2 && size<=n/2)
                ans = min(ans, size);
        }
    }
    if(ans > 1)
        cout << n - ans + 1 << endl;
    else
        cout << n << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
string s;

int main()
{int n;cin>>n;
cin>>s;
int max_seq=0;
for(int i=0;i<n;i++){string sequence="";
    for(int j=i;j<n;j++)
{
sequence+=s[j];
if(s.find(sequence,j+1)==j+1){cout<<sequence<<endl;int len=sequence.size(); max_seq=max(max_seq,len);}
}
}
cout<<min(n,n-max_seq+1)<<endl;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

    string str;
    int mx=0;
    int m;
    cin>>m;
    cin.ignore();
    cin>>str;

    int l=str.size();

    int k=0,ct=0;
    for(int i=0 ; i<l ; i++){
        for(int j=i+1 ; j<l ; j++){
                ct=0;
            if(str[i]==str[j]){
                int p=i,p1=j,p2=j;
                while(str[p]==str[p2] && p<p1){
                    p++,p2++;
                    ct++;
                }
                mx=max(ct,mx);
            }
            mx=max(ct,mx);
        }
        mx=max(ct,mx);
    }

    mx=max(ct,mx);
    //cout<<mx<<endl;
    int ans;
    if(mx)
     ans=(l-mx)+1;
    else
        ans=(l-mx);

    return !(cout<<ans<<endl);
}

/*********************************
Date: Thu May 17 22:49:33 CST 2018
Author: ycl
*********************************/
#include <bits/stdc++.h>
using namespace std;
#define CL(a) memset(a,0,sizeof(a))
#define Cl(a,b) memset(a,b,sizeof(a))
#define MP(a,b) make_pair(a,b)
#define INF 0x7fffffff
#define ll long long
const int mod = 1e9 + 7;
const int maxn = 1e6 + 100;
int Next[maxn];
char s[maxn];
void getNext()
{
	Next[0] = 0;
	int k = 0;
	for (int i = 2;s[i];++i){
		while (k>0 && s[i] != s[k+1])
			k = Next[k];
		if (s[i] == s[k+1]) ++k;
		Next[i] = k;
	}
}
int f[maxn];
int main()
{
	int n;
	scanf("%d",&n);
	scanf("%s",s+1);
	getNext();
	for (int i = 0;i <= n;++i) f[i] = n+1;
	f[0] = 0;
	for (int i = 1;i<=n;++i){
		int k = i;
		while (i%2==0 && k>0 && Next[k] != i/2) k = Next[k];
		if (i%2 || Next[i] == 0 || Next[k]*2 != i) f[i] = f[i-1] + 1;
		else f[i] = min(f[i-1],f[i/2]) + 1;
	}
	printf("%d\n",f[n]);
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main()
{
    double cnt  = 1;
    string str;
    str = "";
    string okay;
    okay = "";
    int m = 0;
    bool flag = false;

    double n;
    cin >>n;
    string a;
    cin >> a;
    set<char>st;
    str+=a[0];
    st.insert(a[0]);
    int ind = 0;
    for(int i = 1 ; i<n; i++)
    {
        st.insert(a[i]);
        if(a[i] == str[m])
        {
            m++;
            flag = true;
            okay += a[i];
            if(m == str.size())
            {
                cnt++;
                m  = 0;
                okay = "";
                ind = i;
                break;
            }
        }
        else
        {
            if(!flag)
            {
                str += a[i];
            }
            else
            {
                str+=okay;
                okay = "";
                flag = false;
                str += a[i];
            }
            m = 0;
        }
    }
    m = 0;
    int tre = 0;
    bool done = false;
    for(int i = ind + 1; i <n; i++)
    {
        st.insert(a[i]);
        if(str[m] == a[i])
        {
            m++;
            done = false;
            if(m == str.size())
            {
                done = true;
                cnt++;
                m = 0;
            }
        }
        else
        {

            tre = i;
            break;
        }
    }
    // cout << tre << endl;
    if(n == 1)
    {
        cout << "1" << endl;
    }
    else if(st.size() == 1)
    {
        cout << ceil(n/2) + 1 << endl;
    }
   else if(tre == 0)
    {
        if(!done)
        {
            cout << str.size() * ceil(cnt/2) + 1 + m << endl;
        }
        else
            cout << str.size() * ceil(cnt/2) + 1 << endl;
    }

    else if(st.size() == n || cnt == 1)
    {
        cout << n << endl;
    }
    else
    {
        //cout << cnt << endl;
        // cout << ((str.size() * ceil(cnt/2)) + 1) << endl;
        cout << ((str.size() * ceil(cnt/2)) + 1) + (a.size() - tre) << endl;
    }
}
/**
16
abcabcabcabcabca
**/

#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <map>
using namespace std;
#define lon long long
int main()
{
    int n, i, j, cnt=0,mx=0;
    string s;
    vector <string> vc;
    vector <int> mn, mmx;
    cin >> n;
    cin >> s;
    int m = n/2;
    while(m>1) {
        for(i=0; i+m <=n; i++) {
            string ss;
            for(j=i; j<i+m; j++) ss+=s[j];
            vc.push_back(ss);
            mn.push_back(i);
            mmx.push_back(i+m-1);
        }
        m--;
    }
    m = vc.size();
    for(i=0; i<m; i++) {
        for(j=i+1; j<m; j++) {
            if(vc[i]==vc[j] && (mn[j]>mmx[i])) {
                cnt = vc[i].length()-1;
                mx = max(cnt,mx);
            }
        }
    }
    cout << n-mx << endl;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;
#define pb push_back
#define fst first
#define snd second

int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	int cnt = 0;
	if(n &1) goto c;
	for(int i = 0; i <n/2; i++)
	{
		if(s[i] != s[n-i-1])
		{
			goto b;
		}
	}
	cout << n/2 +1<< "\n";
	return 0;
	b:;
	c:;
	for(int i = 0; i+1 <n; i++)
	{
		string s1 = s.substr(0,i);
		cerr << s1 << " ";
		if(s1 == s.substr(i+1,s1.size()))
		{
			i = i + s1.size();
			//cout << i << "\n";
			cnt++;
			continue;
		}
		cnt++;
		a:;
	}

	cout << cnt+1 << "\n";
}

//ONBVD NN
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mod 1000000007
// #define mod (int) 998244353
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define deb(x) cout<<#x<<" "<<x<<endl;
int gcd(int a, int b);
void print(int arr[], int n);
void printv(vector<int>arr);

signed main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    fio;

    int n;cin>>n;
    string s;cin>>s;

    int ans = 0;

    string k = "";

    k += s[0];
    ans++;

    for(int i=1;i<n;i++){
        if(i<=n/2 && s.substr(0, i) == s.substr(i, i)){
            ans++;
            k += s.substr(0, i);
            i = 2*i -1 ;
            // i += (i+1);
            // cout<<k<<endl;
            // if(i % 2 == 0)i = 2*i - 1;
            // else i = 2*i;
        }
        else {ans++;k+=s[i];}
        //deb(i);deb(ans);
    }

    cout<<ans<<endl;

}

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

void print(int arr[], int n)
{
    for(int i=0;i<n;i++)cout<<arr[i]<<" ";
    cout<<endl;
}

void printv(vector<int>arr)
{
    for(int i=0;i<arr.size();i++)cout<<arr[i]<<" ";
    cout<<endl;
}

//#define debug
#include<stdio.h>
#include<math.h>
#include<cmath>
#include<queue>
#include<stack>
#include<string>
#include<cstring>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<vector>
#include<functional>
#include<iomanip>
#include<map>
#include<set>
//#define f first
#define s second
#define pb push_back
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll>PLL;
typedef pair<int,ll>Pil;
const ll INF = 0x3f3f3f3f;
const double inf=1e8+100;
const double eps=1e-8;
const int maxn =1e6+100;
const int N = 1e3+10;
const ll mod=1e9+7;
//------
/*
int n;
	cin>>n;
	while(n--){
		int t;
		cin>>t;
		fx=0;
		sum1=0;
		sum2=0;
		ll fy=0;
		for(int i=1;i<=t;i++){
			cin>>a[i];
			sum1=sum1+a[i];
		}
		for(int i=1;i<=t;i++){
			cin>>b[i];
			sum2=sum2+b[i];
			fx+=a[i]*b[i];
			fy+=(t-1)*a[i]*b[i];
		}
		ll sum=sum1*sum2;
		cout<<fx-sum+fy<<endl;
	}
*/
//define
string ss;
int n;
bool check(int l,int r,int len) {
	int le=l,re=r;
	while(r<n) {
		if(ss[l]!=ss[r]) {
			return 0;
		}
		//	cout<<l<<endl;
		l++;
		r++;
		//	cout<<ss[l]<<" "<<ss[r]<<endl;
	}
	return 1;
}
//solve
void solve() {
	int tt=1;
	cin>>tt;
	while(tt--) {
		int t=-1;
	//	cin>>n>>ss;
		for(int i=0; i<n; i++) {
			string tmp=ss.substr(0,i+1);
			tmp+=tmp;
			string tmp1=ss.substr(0,2*(i+1));
			//	cout<<tmp<<endl<<tmp1<<endl;
			if(tmp1.find(tmp)!=-1) {
				t=max(t,i);
			}
		}
		if(t==-1) {
			cout<<n<<endl;
		} else {
			cout<<n-t<<endl;
		}
	}
}
//main
int main() {
	ios_base::sync_with_stdio(false);
#ifdef debug
	freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
	cin.tie(0);
	cout.tie(0);
	solve();
	/*
		#ifdef debug
			fclose(stdin);
			fclose(stdout);
			system("out.txt");
		#endif
	*/
	return 0;
}

#include<bits/stdc++.h>
//#include<unordered_map>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<stack>
#include<set>
#include<bitset>
#include<sstream>
using namespace std;
#define int long long
#define ull unsigned long long
//#define ll long long
#define str string
#define db double
//#define ac() cout<<"Yes"<<endl
//#define wa()  cout<<"No"<<endl
void ac(int x){if(x)puts("YES");else puts("NO");}
#define ddd cout<<"---debug---"<<endl;
#define ff(a,b) for(signed long long (a)=1;(a)<=(b);(a)++)
#define fff(a,b) for(signed long long (a)=0;(a)<(b);(a)++)
#define re readdd()
#define pr(a) printtt(a)
#define pee puts("");
#define eee putchar(' ');
#define pss(a) push_back(a)
#define ps(a) push(a)
#define SZ(x) (int)x.size()
#define epp empty()
#define all(x) x.begin(),x.end()
#define asd signed QP;scanf("%d",&QP);while(QP--)
#define alll(x,y) x+1,x+1+y
typedef pair<int,int> PI;
typedef vector<int> VE;
#define fir first
#define sec second
#define ist insert
int gcd(int a,int b){return b==0?a:gcd(b,a%b);}//
int ppow(int a,int b,int mod){a%=mod;//
int ans=1%mod;while(b){if(b&1)ans=(long long)ans*a%mod;
a=(long long)a*a%mod;b>>=1;}return ans;}
int readdd(){int x=0,f=1;char c=getchar();//
while(!isdigit(c)&&c!='-')c=getchar();
if(c=='-')f=-1,c=getchar();
while(isdigit(c))x=x*10+c-'0',c=getchar();
return f*x;}
void printtt(int x){if(x<0)putchar('-'),x=-x;
if(x>=10)printtt(x/10);putchar(x%10+'0');}
bool addd(int a,int b){return a>b;}
int lowbit(int x){return x&-x;}
const int dx[4]={0,0,1,-1};
const int dy[4]={1,-1,0,0};
//
const int BN=2e6+5;
struct BIT{
    int c[BN];
    void init(){memset(c,0,sizeof c);}
    int lowbit(int i){return i&-i;}
    void add(int i,int t){while(i<BN)c[i]+=t,i+=lowbit(i);}
    int ask(int i){int ans=0;while(i)ans+=c[i],i-=lowbit(i);return ans;}
};
bool Isprime(int x){
    for(int i=2;i*i<=x;i++)if(x%i==0)return 0;
    return 1;
}
//const int FN=2e6+5;
//int pre[FN];
//int ffind(int x){
//    return pre[x]==x?x:pre[x]=ffind(pre[x]);
//}
void init(){;}
const double Pi=acos(-1);
const double eps=1e-7;
const int mod=1e9+7;
//const int mod=998244353;
const int modd=mod-1;
//
const int maxm=1e6+5;
char s[maxm];
int mark[maxm];
void solve(){
    int n=re;
    scanf("%s",s+1);
    int ans=0;
    for(int i=1;i<=n;i++){
        ans++;
        int l=i+1;
        int r=i*2;
        if(r<=n){
            int ok=1;
            int tot=0;
            for(int j=l;j<=r;j++){
                if(s[j]!=s[++tot]){
                    ok=0;break;
                }
            }
            if(ok){
                ans++;
                i=r;continue;
            }
        }
    }
    pr(ans);
}
signed main(){
    init();
//    while(1)
//    asd
        solve();
    return 0;
}
/*

*/

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n;
	cin>>n;
	string st;
	cin>>st;
	int ans=0;
	for(int j=0;j<n;j++){
		for(int k=2;k+j<=n;k+=2){
			string q=st.substr(j,k);
			//cout<<q<<endl;
			int siz=q.size();
			bool mark=false;
			for(int l=0;l<siz/2;l++){
				if(q[l]!=q[siz/2+l]){
					mark=true;
					break;
				}
			}
			if(mark==false)
				ans=max(ans,siz/2);
		}
	}
	if(ans!=0)cout<<n-ans+1;
	else cout<<n;
	return 0;
}

#include<bits/stdc++.h>
//#include<unordered_map>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<stack>
#include<set>
#include<bitset>
#include<sstream>
using namespace std;
#define int long long
#define ull unsigned long long
//#define ll long long
#define str string
#define db double
//#define ac() cout<<"Yes"<<endl
//#define wa()  cout<<"No"<<endl
void ac(int x){if(x)puts("YES");else puts("NO");}
#define ddd cout<<"---debug---"<<endl;
#define ff(a,b) for(signed long long (a)=1;(a)<=(b);(a)++)
#define fff(a,b) for(signed long long (a)=0;(a)<(b);(a)++)
#define re readdd()
#define pr(a) printtt(a)
#define pee puts("");
#define eee putchar(' ');
#define pss(a) push_back(a)
#define ps(a) push(a)
#define SZ(x) (int)x.size()
#define epp empty()
#define all(x) x.begin(),x.end()
#define asd signed QP;scanf("%d",&QP);while(QP--)
#define alll(x,y) x+1,x+1+y
typedef pair<int,int> PI;
typedef vector<int> VE;
#define fir first
#define sec second
#define ist insert
int gcd(int a,int b){return b==0?a:gcd(b,a%b);}//
int ppow(int a,int b,int mod){a%=mod;//
int ans=1%mod;while(b){if(b&1)ans=(long long)ans*a%mod;
a=(long long)a*a%mod;b>>=1;}return ans;}
int readdd(){int x=0,f=1;char c=getchar();//
while(!isdigit(c)&&c!='-')c=getchar();
if(c=='-')f=-1,c=getchar();
while(isdigit(c))x=x*10+c-'0',c=getchar();
return f*x;}
void printtt(int x){if(x<0)putchar('-'),x=-x;
if(x>=10)printtt(x/10);putchar(x%10+'0');}
bool addd(int a,int b){return a>b;}
int lowbit(int x){return x&-x;}
const int dx[4]={0,0,1,-1};
const int dy[4]={1,-1,0,0};
//
const int BN=2e6+5;
struct BIT{
    int c[BN];
    void init(){memset(c,0,sizeof c);}
    int lowbit(int i){return i&-i;}
    void add(int i,int t){while(i<BN)c[i]+=t,i+=lowbit(i);}
    int ask(int i){int ans=0;while(i)ans+=c[i],i-=lowbit(i);return ans;}
};
bool Isprime(int x){
    for(int i=2;i*i<=x;i++)if(x%i==0)return 0;
    return 1;
}
//const int FN=2e6+5;
//int pre[FN];
//int ffind(int x){
//    return pre[x]==x?x:pre[x]=ffind(pre[x]);
//}
void init(){;}
const double Pi=acos(-1);
const double eps=1e-7;
const int mod=1e9+7;
//const int mod=998244353;
const int modd=mod-1;
//
const int maxm=1e6+5;
char s[maxm];
int d[maxm];
int mark[maxm];
int n;
int check(int l,int r){
    int tot=0;
    for(int i=l;i<=r;i++){
        if(s[i]!=s[++tot])return 0;
    }
    return 1;
}
void solve(){
    n=re;
    scanf("%s",s+1);
    int ans=n;
    for(int i=n;i>=1;i--){
        if(i%2==0&&check(i/2+1,i)){
            ans=min(ans,i/2+n-i);
        }
    }
    pr(ans);
}
signed main(){
    init();
//    while(1)
//    asd
        solve();
    return 0;
}
/*

*/

#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main(){
    ll n,ans=0;
    string s;
    cin>>n>>s;
    for(ll i=0;i<n;i++){
        for(ll j=i+1;j<min(i+1+i,n);j++){
            ll match=0,p=0;
            while(p+i<n && p+j<n && s[p+i]==s[p+j] && i+p<j){
                match++;
                p++;
            }
            if(match==i+1)  ans=max(ans,match);
            // cout<<match<<endl;
        }
    }
    // cout<<ans<<endl;
    if(ans!=0)  ans--;
    cout<<n-ans<<endl;
    return 0;
}

#include <iostream>
#include <map>
#include <vector>
#include <string>
using namespace std;

map<string, int> m;
int main() {
	int n;
	cin >> n;
	string s;
	cin >> s;

	int ans = 0;
	for (int i = 0; i < s.size() - 1; i++) {
		string temp = "";
		temp += s[i];
		for (int k = i + 1; k < s.size(); k++) {
			temp += s[k];
			if (m[temp] != 0) {
				if (m[temp] + temp.size() == i + 1) {
					if (ans < temp.size())ans = temp.size();
				}
			}
			else {
				m[temp] = i + 1;
			}
		}
	}
	while (ans * 2 > n) {
		ans -= 1;
	}
	if (ans == 0) {
		cout << n << '\n';
	}
	else {
		cout << n - ans + 1 << '\n';
	}
}