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

Given an integer array arr, count how many elements x there are, such that x + 1 is also in arr. If there are duplicates in arr, count them separately.
 
Please complete the following python code precisely:
```python
class Solution:
    def countElements(self, arr: List[int]) -> int:
```