```
class Solution {
public:
int minSteps(int n) {
int tmp_n = n-1;
int size = 1;
int step = 0;
while(tmp_n != 0){
if(tmp_n%(n-tmp_n) == 0){
step +=2;
size = n-tmp_n;
tmp_n -= size;
}else{
step += 1;
tmp_n -= size;
}
}
return step;
}
};
```