{"raw_statement":[{"iden":"problem statement","content":"Takahashi is standing on a multiplication table with infinitely many rows and columns.\nThe square $(i,j)$ contains the integer $i \\times j$. Initially, Takahashi is standing at $(1,1)$.\nIn one move, he can move from $(i,j)$ to either $(i+1,j)$ or $(i,j+1)$.\nGiven an integer $N$, find the minimum number of moves needed to reach a square that contains $N$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 10^{12}$\n*   $N$ is an integer."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$"},{"iden":"sample input 1","content":"10"},{"iden":"sample output 1","content":"5\n\n$(2,5)$ can be reached in five moves. We cannot reach a square that contains $10$ in less than five moves."},{"iden":"sample input 2","content":"50"},{"iden":"sample output 2","content":"13\n\n$(5, 10)$ can be reached in $13$ moves."},{"iden":"sample input 3","content":"10000000019"},{"iden":"sample output 3","content":"10000000018\n\nBoth input and output may be enormous."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}