# -*- coding: utf-8 -*-
import sys


def main():
    N = int( sys.stdin.readline() )
    c_list = list(sys.stdin.readline().rstrip())
    

    num_R = c_list.count("R")
    cnt = 0

    for i in range(num_R):
        if c_list[i] == "W":
            cnt += 1
    
    print(cnt)


if __name__ == "__main__":
    main() import sys sys def main():
    N = int( sys.stdin.readline() )
    c_list = list(sys.stdin.readline().rstrip())
    

    num_R = c_list.count("R")
    cnt = 0

    for i in range(num_R):
        if c_list[i] == "W":
            cnt += 1
    
    print(cnt) main N = int( sys.stdin.readline() ) N int( sys.stdin.readline() ) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline c_list = list(sys.stdin.readline().rstrip()) c_list list(sys.stdin.readline().rstrip()) list sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip num_R = c_list.count("R") num_R c_list.count("R") c_list.count c_list count "R" cnt = 0 cnt 0 for i in range(num_R):
        if c_list[i] == "W":
            cnt += 1
    
     i range(num_R) range num_R if c_list[i] == "W":
            cnt += 1
    
     c_list[i] == "W" c_list[i] c_list i "W" cnt += 1 cnt 1 print(cnt) print cnt if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N = int( sys.stdin.readline() )
    c_list = list(sys.stdin.readline().rstrip())
    

    num_R = c_list.count("R")
    cnt = 0

    for i in range(num_R):
        if c_list[i] == "W":
            cnt += 1
    
    print(cnt) def main():
    N = int( sys.stdin.readline() )
    c_list = list(sys.stdin.readline().rstrip())
    

    num_R = c_list.count("R")
    cnt = 0

    for i in range(num_R):
        if c_list[i] == "W":
            cnt += 1
    
    print(cnt) main
# -*- coding: utf-8 -*-
import sys


def main():
    N = int( sys.stdin.readline() )
    c_list = list(sys.stdin.readline().rstrip())
    

    num_R = c_list.count("R")
    cnt = 0

    for i in range(num_R):
        if c_list[i] == "W":
            cnt += 1
    
    print(cnt)


if __name__ == "__main__":
    main()
