// file: sqRoot.cpp
// by: Carrano, Helman, Veroff


// Should compute the floor of teh square root of its input value X. 
//   (The floor of a number n is the largest integer less than or equal to n.)
// To compile: g++ -g -o sqRoot sqRoot.cpp

#include <iostream.h>

int main() {

  int X;    // input value


  // initialize
  int Result = 0;           // will equal floor of sqrt(x)
  int Temp1 = 1;
  int Temp2 = 1;

  cin >> X;                 // read input

  // compute floor
  while (Temp1 < X) {
    ++Result;
    Temp2 += 2;
    Temp1 += Temp2;
  }  // end while

  cout << "The floor of the square root of "
       << X << " is " << Result << endl;

  return 0;
}  // end while
