```
import math
class Solution(object):
def minSteps(self, n):
"""
:type n: int
:rtype: int
"""
# base case
if n == 1:
return 0
# even
elif not n%2:
return self.minSteps(n/2)+2
# prime odd or non-prime odd
else:
for i in range(3,int(math.ceil(math.sqrt(n))+1),2):
if not n%i:
return self.minSteps(i) + self.minSteps(n/i)
return n
```