/** * Tittle: 10323 - Factorial! You Must be Kidding!!! * Author: Cheng-Shih, Wong * Date: 2015/06/17 */ // include files #include <bits/stdc++.h> using namespace std; // definitions #define FOR(i,a,b) for( int i=(a),_n=(b); i<=_n; ++i ) #define clr(x,v) memset( x, v, sizeof(x) ) typedef long long ll; // declarations int n; ll fact[15]; // functions // main function int main( void ) { fact[0] = 1LL; FOR( i, 1, 13 ) fact[i] = fact[i-1]*i; // input while( scanf( "%d", &n )==1 ) { if( n < 0 ) { if( ((-n)&1)==1 ) puts("Overflow!"); else puts("Underflow!"); } else { if( n<=7 ) puts("Underflow!"); else if( n>=14 ) puts("Overflow!"); else printf( "%lld\n", fact[n] ); } } return 0; }