#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
int a[100][100];
int main() {
  int n;
  scanf("%d", &n);
  long long ans = n;
  for (int i = 2; i * i <= n; i++)
    while (n % i == 0) ans += n /= i;
  if (n > 1) ans += n /= n;
  printf("%I64d\n", ans);
}
