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

You are given a string s of length n containing only four kinds of characters: 'Q', 'W', 'E', and 'R'.
A string is said to be balanced if each of its characters appears n / 4 times where n is the length of the string.
Return the minimum length of the substring that can be replaced with any other string of the same length to make s balanced. If s is already balanced, return 0.
 
Please complete the following python code precisely:
```python
class Solution:
    def balancedString(self, s: str) -> int:
```