output_description: Print the minimum number of moves needed to reach a square that contains the
  integer N.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: n = int(input())
  left = 1
  right = n
  ans_l = 1
  while left <= right:
      left += 1
      right = n / left
      if n / left % 1 == 0:
          right = int(n / left)
          ans_l = left
  ans_r = n // ans_l
  print(ans_l + ans_r - 2)
  
problem_description: Statement
  
  Takahashi is standing on a multiplication table with infinitely many rows and
  columns.
  
  The square (i,j) contains the integer i \times j. Initially, Takahashi is
  standing at (1,1).
  
  In one move, he can move from (i,j) to either (i+1,j) or (i,j+1).
  
  Given an integer N, find the minimum number of moves needed to reach a square
  that contains N.
samples: [{"input": "10", "output": "5\n    \n\n(2,5) can be reached in five moves. We cannot reach a square that contains 10\nin less than five moves.\n\n* * *"}, {"input": "50", "output": "13\n    \n\n(5, 10) can be reached in 13 moves.\n\n* * *"}, {"input": "10000000019", "output": "10000000018\n    \n\nBoth input and output may be enormous."}]