public static void main ( String [ ] args ) throws IOException {
  BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  String str = br . readLine ( ) ;
  int N = Integer . parseInt ( str ) ;
  long mod = 1_000_000_007 ;
  long [ ] [ ] [ ] [ ] dp = new long [ N + 1 ] [ 4 ] [ 4 ] [ 4 ] ;
  dp [ 0 ] [ 3 ] [ 3 ] [ 3 ] = 1 ;
  for ( int len = 0 ;
  len < N ;
  len ++ ) {
    for ( int c1 = 0 ;
    c1 < 4 ;
    c1 ++ ) {
      for ( int c2 = 0 ;
      c2 < 4 ;
      c2 ++ ) {
        for ( int c3 = 0 ;
        c3 < 4 ;
        c3 ++ ) {
          if ( dp [ len ] [ c1 ] [ c2 ] [ c3 ] == 0 ) {
            continue ;
          }
          for ( int a = 0 ;
          a < 4 ;
          a ++ ) {
            if ( a == 2 && c1 == 1 && c2 == 0 ) {
              continue ;
            }
            else if ( a == 2 && c1 == 0 && c2 == 1 ) {
              continue ;
            }
            else if ( a == 1 && c1 == 2 && c2 == 0 ) {
              continue ;
            }
            else if ( a == 2 && c1 == 1 && c3 == 0 ) {
              continue ;
            }
            else if ( a == 2 && c2 == 1 && c3 == 0 ) {
              continue ;
            }
            dp [ len + 1 ] [ a ] [ c1 ] [ c2 ] += dp [ len ] [ c1 ] [ c2 ] [ c3 ] ;
            dp [ len + 1 ] [ a ] [ c1 ] [ c2 ] %= mod ;
          }
        }
      }
    }
  }
  long ans = 0 ;
  for ( int c1 = 0 ;
  c1 < 4 ;
  c1 ++ ) {
    for ( int c2 = 0 ;
    c2 < 4 ;
    c2 ++ ) {
      for ( int c3 = 0 ;
      c3 < 4 ;
      c3 ++ ) {
        ans += dp [ N ] [ c1 ] [ c2 ] [ c3 ] ;
      }
    }
  }
  System . out . println ( ans %= mod ) ;
}

public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; int N = Integer . parseInt ( str ) ; long mod = 1_000_000_007 ; long [ ] [ ] [ ] [ ] dp = new long [ N + 1 ] [ 4 ] [ 4 ] [ 4 ] ; dp [ 0 ] [ 3 ] [ 3 ] [ 3 ] = 1 ; for ( int len = 0 ; len < N ; len ++ ) { for ( int c1 = 0 ; c1 < 4 ; c1 ++ ) { for ( int c2 = 0 ; c2 < 4 ; c2 ++ ) { for ( int c3 = 0 ; c3 < 4 ; c3 ++ ) { if ( dp [ len ] [ c1 ] [ c2 ] [ c3 ] == 0 ) { continue ; } for ( int a = 0 ; a < 4 ; a ++ ) { if ( a == 2 && c1 == 1 && c2 == 0 ) { continue ; } else if ( a == 2 && c1 == 0 && c2 == 1 ) { continue ; } else if ( a == 1 && c1 == 2 && c2 == 0 ) { continue ; } else if ( a == 2 && c1 == 1 && c3 == 0 ) { continue ; } else if ( a == 2 && c2 == 1 && c3 == 0 ) { continue ; } dp [ len + 1 ] [ a ] [ c1 ] [ c2 ] += dp [ len ] [ c1 ] [ c2 ] [ c3 ] ; dp [ len + 1 ] [ a ] [ c1 ] [ c2 ] %= mod ; } } } } } long ans = 0 ; for ( int c1 = 0 ; c1 < 4 ; c1 ++ ) { for ( int c2 = 0 ; c2 < 4 ; c2 ++ ) { for ( int c3 = 0 ; c3 < 4 ; c3 ++ ) { ans += dp [ N ] [ c1 ] [ c2 ] [ c3 ] ; } } } System . out . println ( ans %= mod ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (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 (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (identifier) right: (decimal_integer_literal))) dimensions: (dimensions_expr (decimal_integer_literal)) dimensions: (dimensions_expr (decimal_integer_literal)) dimensions: (dimensions_expr (decimal_integer_literal))))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (array_access array: (array_access array: (identifier) index: (decimal_integer_literal)) index: (decimal_integer_literal)) index: (decimal_integer_literal)) index: (decimal_integer_literal)) right: (decimal_integer_literal))) (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)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) index: (identifier)) index: (identifier)) right: (decimal_integer_literal))) consequence: (block (continue_statement))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (continue_statement)) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (continue_statement)) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (continue_statement)) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (continue_statement)) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (continue_statement))))))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) index: (identifier)) index: (identifier)) right: (array_access array: (array_access array: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) index: (identifier)) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (identifier)) index: (identifier)) index: (identifier)) right: (identifier))))))))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (array_access array: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) index: (identifier)) index: (identifier)))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (assignment_expression left: (identifier) right: (identifier)))))))