```
class Solution(object):
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
if n<3:
return n
else:
first = 1
second = 2
i = 3
while i<n:
nsecond = first+second
first = second
second = nsecond
i+=1
return first+second
```