def solve(string):
    _, c = string.split()
    r = c.count("R")
    return str(c[:r].count("W"))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip())) def solve(string):
    _, c = string.split()
    r = c.count("R")
    return str(c[:r].count("W")) solve _, c = string.split() _ string.split() string.split string split c r = c.count("R") r c.count("R") c.count c count "R" return str(c[:r].count("W")) str(c[:r].count("W")) str c[:r].count("W") [:r].count [:r] c :r r count "W" string string if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip())) __name__ == '__main__' __name__ '__main__' import sys sys print(solve(sys.stdin.read().strip())) print solve(sys.stdin.read().strip()) solve sys.stdin.read().strip() sys.stdin.read().strip sys.stdin.read() sys.stdin.read sys.stdin sys stdin read strip def solve(string):
    _, c = string.split()
    r = c.count("R")
    return str(c[:r].count("W")) def solve(string):
    _, c = string.split()
    r = c.count("R")
    return str(c[:r].count("W")) solve
def solve(string):
    _, c = string.split()
    r = c.count("R")
    return str(c[:r].count("W"))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
