```
def minSteps(self, n):
"""
:type n: int
:rtype: int
"""
def dp(n):
if n==1:return 0
for k in range(2,int(math.sqrt(n))+1):
if n % k ==0:return k+dp(n//k)
return n
return dp(n)
```