An integer N (1 ≤ N ≤ 100), representing the length of a string.
A string S of length N, where each character is one of {'L', 'R', 'U', 'D'}.

### Example Input:

```
8
RUDLUDRL
```

### Function Signature:
Write a function f(N, S) that takes in the input.
def f(N: int, S: str):
    '''
    N: an integer
    S: a string
    '''