input = gets.to_i
dp=Array.new(101).map{Array.new(4,0).map{Array.new(4,0).map{Array.new(4,0)}}}
#dp[101][4][4][4] = kazu
dp[0][3][3][3] = 1
mod = 10 ** 9 + 7
input.times{|kazu|
    4.times{|c1|
       4.times{|c2|
            4.times{|c3|
                4.times{|a|	
					#ダメな5つの条件をカットする
					if (a == 2 && c1 == 1 && c2 == 0) then next end
					if (a == 2 && c1 == 0 && c2 == 1) then next end
					if (a == 1 && c1 == 2 && c2 == 0) then next end
					if (a == 2 && c1 == 1 && c3 == 0) then next end
					if (a == 2 && c2 == 1 && c3 == 0) then next end
 
					dp[kazu + 1][a][c1][c2] += dp[kazu][c1][c2][c3]
					dp[kazu + 1][a][c1][c2] %= mod           
                }
            }
        } 
    }
}
ans = 0
4.times{|c1|
4.times{|c2|
4.times{|c3|
ans += dp[input][c1][c2][c3];
ans %= mod;
}
}
}
print ans