My Submission || JAVA
\n\n# Code\n\nclass Solution {\n    \n    \n    int cal(int num){\n        int out=0;\n        for(int i = 2; i< num; i++) {\n           while(num%i == 0) {\n  
\n\n# Code\n```\nclass Solution {\n    \n    \n    int cal(int num){\n        int out=0;\n        for(int i = 2; i< num; i++) {\n           while(num%i == 0) {\n              out+=i;\n              num = num/i;\n           }\n        }\n        if(num >2) {\n           out+=num;\n        }\n        return out;\n    }\n    \n    public int smallestValue(int n) {\n        while(n!=cal(n)){\n           \n            if(n<4)\n                return n; \n            n=cal(n);\n        }\n              \n        return n;\n    }\n}\n```
['Java']