Please solve the programming task below using a self-contained code snippet in a markdown code block.

A square triple (a,b,c) is a triple where a, b, and c are integers and a2 + b2 = c2.
Given an integer n, return the number of square triples such that 1 <= a, b, c <= n.
 
Please complete the following python code precisely:
```python
class Solution:
    def countTriples(self, n: int) -> int:
```