System: affiche juste le code, pas d'explications !
User: 
Tu es un développeur python3 expérimenté, et tu dois concevoir un programme en python (avec des commentaires en français, sans utiliser de librairies externes, sans `if __name__=="__main__":`, avec type hints, et en privilégiant les algorythmes a complexité constante (O(1)) et/ou complexité linéaire (O(n))).
Le programme va recevoir les données en entrée sur la stdin, et doit répondre sur la stdout.
Fabrique moi un programme python qui résout le problème (énoncé en markdown) suivant :
-----------------------------------------------------
# Anatomy of a fall

The show jumping event consists of a succession of walls placed one after the other along the course. These opaque walls are painted either white or black.

You want the riders to be able to see their course and the obstacles ahead as clearly as possible when they are positioned at the start of the course. However, given that the walls are all placed one after the other, it is possible for a wall to be completely hidden if it is positioned after a wall at least as high as it. It is also possible for several walls to appear, to the rider's eye at the start of the course, as a single wall. 

Let's take the following example with three walls:
- wall `A`, in front, has a height of `2` and is coloured `White`,
- wall `B`, in the middle, has a height of `2` and is coloured `Black`,
- wall `C`, located behind, has a height of `4` and is coloured `White`.

Because wall `B` is placed behind a wall as high as it is, it is completely hidden. The only walls visible are `A` and `C`, which are the same colour and therefore appear to be a single wall.

The walls have already been placed. In order to rearrange the obstacles to avoid any confusion, you want to count the number of walls that can be confused with others, still from the point of view of the riders at the beginning of the track.

## Data

### Input

**Line 1** : An integer `N`, representing the number of walls.

**Line 2 to N+1** : An integer `H`, representing the height of a wall, followed by a string, either `Black` or `White`, representing the colour of the wall.

The integer `N` is between `1` and `10000` included.
Each integer `H` is between `1` and `100` included.


### Output

The number of confusing walls.

## Example

For input :
```plaintext
5
1 Black
2 Black
3 White
4 Black
5 Black
```

Your program should return :
```plaintext
4
```

Each wall is higher than the ones before. They are therefore all visible. Since the first wall has the same colour as the second one, those two can be confused together. Same goes for the fourth and the fifth, which leads to 4 confusing walls.

---

For input :
```plaintext
6
3 White
2 White
4 White
1 White
4 White
5 White
```

Your program should return :
```plaintext
3
```

Here, the second, fourth and fifth walls are hidden by other wall places before. It remains only 3 walls which are visible from the start of the track. Since they all have the same colour, they can all be confused together.

---

For input :
```plaintext
4
1 White
3 Black
5 White
7 Black
```

Your program should return :
```plaintext
0
```

In this example, no wall is hidden. Since the colours are alternating, no pair of wall can be seen as a unique wall.
Assistant: '''python
import sys
from typing import List, Tuple

def count_confusing_walls(walls: List[Tuple[int, str]]) -> int:
    max_height = 0
    visible_walls = []
    
    for height, color in walls:
        if height > max_height:
            visible_walls.append(color)
            max_height = height
    
    confusing_count = 0
    color_count = {}
    
    for color in visible_walls:
        if color in color_count:
            color_count[color] += 1
        else:
            color_count[color] = 1
    
    for count in color_count.values():
        if count > 1:
            confusing_count += count
    
    return confusing_count

def read_input() -> List[Tuple[int, str]]:
    input_data = sys.stdin.read().strip().splitlines()
    n = int(input_data[0])
    walls = []
    for i in range(1, n + 1):
        height, color = input_data[i].split()
        walls.append((int(height), color))
    return walls

walls = read_input()
result = count_confusing_walls(walls)
print(result)'''
User: Avec l'input:
```4
1 White
3 Black
5 White
7 Black```
Je m'attendais à obtenir l'output:
```0```
Mais j'ai obtenu:
```4```
Ce qui n'est pas le résultat attendu !

Peux tu corriger le programme !
Assistant: