#include <stdio.h>

void *stack[1024], **sp = stack;

#define CAT_(a, ...) a ## __VA_ARGS__
#define CAT(...)     CAT_(__VA_ARGS__)
#define GOSUB(lbl)   {*sp++ = &&CAT(L, __LINE__); goto lbl; CAT(L, __LINE__):;}
#define RETURN       goto *--sp

int main(void) {
    int n, f;
    scanf("%d", &n);
    GOSUB(factorial);
    printf("%d", f);
    return 0;

factorial:
    f = 1;
    while (n)
        f *= n--;
    RETURN;
}
