#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<math.h>
#define ll long long
using namespace std;
int main(){
int n;
int k=;
while(){
k++;
scanf("%d",&n);
if (n==)break;
int m=sqrt(n+);
int cnt=;
ll ans=;
for (int i=;i<=m;i++){
if (n%i==){
ll num=;
cnt++;
while(n%i==){
num*=i;
n/=i;
}
ans+=num;
}
if (n==)break;
}
if (n!= || cnt==){
ans+=n;
cnt++;
}
if (cnt==){
ans++;
}
printf("Case %d: %lld\n",k,ans); }
return ;
}