#import <Foundation/Foundation.h>

int gcd(int a,int b){
    if(a%b==0){return b;}
    return gcd(b,a%b);
}

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        NSData *stdinData = [[NSFileHandle fileHandleWithStandardInput] availableData];
        NSString *s = [[NSString alloc] initWithData:stdinData encoding:NSUTF8StringEncoding];
        int n = [s intValue];
        long long v = (long long)n*2/gcd(n,2);
        NSString *answer = [NSString stringWithFormat:@"%lld", v];
        
        NSFileHandle *fileHandle = [NSFileHandle fileHandleWithStandardOutput];
        [fileHandle writeData:[answer dataUsingEncoding:NSUTF8StringEncoding]];
        [fileHandle writeData:[@"\n" dataUsingEncoding:NSUTF8StringEncoding]];
        [fileHandle closeFile];
    }
    
    return 0;
}
