whats wrong in my code??

https://www.codechef.com/submit/COINS

my solution:
#include <stdio.h>
#include <stdlib.h>
int main()
{
    long long int n,sum;

    while(scanf("%lld",&n)!=EOF)
    {
        sum=(n/2)+(n/4)+(n/3);
        if(n==0)
        if(sum>n)
            printf("%lld\n",sum);
        else
            printf("%lld\n",n);
    }

    return 0;
}
//