#include <stdio.h>                                                                                                                                         
                                                                                                                                                           
int main(void)                                                                                                                                             
{                                                                                                                                                          
        long long num, i = 1, ans = 0, tmp, tmp_prev;                                                                                                      
                                                                                                                                                           
        scanf("%lld", &num);                                                                                                                               
                                                                                                                                                           
        for (;;) {                                                                                                                                         
                tmp = i * i;                                                                                                                               
                if (tmp == num) {                                                                                                                          
                        ans = tmp;                                                                                                                         
                        break;                                                                                                                             
                } else if (tmp > num) {                                                                                                                    
                        ans = tmp_prev;                                                                                                                    
                        break;                                                                                                                             
                }                                                                                                                                          
                tmp_prev = tmp;                                                                                                                            
                i++;                                                                                                                                       
        }                                                                                                                                                  
        printf("%lld\n", ans);                                                                                                                             
        return 0;                                                                                                                                          
} 

Measured memory_bytes: 128