Sum \$\text{Square}^2\$
R, 39 37 bytes



!sum((y=1:(x=scan()))[!x%%y]^2)^.5%%1


Try it online!

Uses the classic "test if perfect square" approach, taking the non-integral part of the square root S^.5%%1 and taking the logical negation of it, as it maps zero (perfect square) to TRUE and nonzero to FALSE.

Thanks to Robert S for saving a couple of bytes!