```
class Solution(object):
def climbStairs(self, n):
if n < 4:
return n
pfirst = 1
psecond = 1
all_ways = 3
for i in range(4,n+1):
pfirst,psecond = pfirst+psecond,pfirst
all_ways += pfirst
return all_ways
```