```ts
export function stepBack(moves: string): number {
    let forwardCount = 0;
    for (const move of moves) {
        if (move === 'F') {
            forwardCount += 1;
        } else if (move === 'B') {
            forwardCount -= 1;
        }
        // Handle negative count by resetting to zero
        if (forwardCount < 0) {
            forwardCount = 0;
        }
    }
    return forwardCount;
}
```