def get_Min_Squares(n):
    
    if n <= 3:
        return n;
    res = n 
    for x in range(1,n + 1):
        temp = x * x;
        if temp > n:
            break
        else:
            res = min(res,1 + get_Min_Squares(n  - temp)) 
    return res;
def get_Min_Squares(n):
    if n <= 3:
        return n
    res = n
    x = 1
    while x < n + 1:
       
        temp = x * x
        if temp > n:
            break
        else:
            res = min(res, 1 + get_Min_Squares(n - temp))
        x += 1
    return res