runtime error when input 3 but works fine in local