------
## 最终结论
```python
def count_Substrings(s, n):
    count = 0
    for i in range(n):
        for j in range(i + 1, n + 1):
            substring = s[i:j]
            if sum(int(digit) for digit in substring) == len(substring):
                count += 1
    return count

# Test cases
assert count_Substrings('112112', 6) == 6
assert count_Substrings('111', 3) == 6
assert count_Substrings('1101112', 7) == 12
```