public static void main ( String args [ ] ) {
  FastScanner input = new FastScanner ( ) ;
  int n = input . nextInt ( ) ;
  String s = " " + input . next ( ) ;
  int i = 1 ;
  int maxcount = 0 ;
  while ( i * 2 <= n ) {
    int stop = i ;
    int k = stop + 1 ;
    boolean check = true ;
    for ( int j = 1 ;
    j <= stop ;
    j ++ , k ++ ) {
      if ( s . charAt ( j ) != s . charAt ( k ) ) {
        check = false ;
      }
    }
    if ( check ) maxcount = Math . max ( maxcount , i ) ;
    i ++ ;
  }
  System . out . println ( maxcount + ( n - maxcount * 2 ) + ( ( maxcount > 0 ) ? 1 : 0 ) ) ;
}

public static void main ( String args [ ] ) { FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; String s = " ▁ " + input . next ( ) ; int i = 1 ; int maxcount = 0 ; while ( i * 2 <= n ) { int stop = i ; int k = stop + 1 ; boolean check = true ; for ( int j = 1 ; j <= stop ; j ++ , k ++ ) { if ( s . charAt ( j ) != s . charAt ( k ) ) { check = false ; } } if ( check ) maxcount = Math . max ( maxcount , i ) ; i ++ ; } System . out . println ( maxcount + ( n - maxcount * 2 ) + ( ( maxcount > 0 ) ? 1 : 0 ) ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (string_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))))) (expression_statement (update_expression (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))))) right: (parenthesized_expression (ternary_expression condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (decimal_integer_literal) alternative: (decimal_integer_literal)))))))))