F. Flow Maximal
time limit per test
4 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
9
Output
14