import 'dart:async';
import 'dart:io';
import 'dart:convert';

Stream<String> get lineStream =>
    stdin.transform(utf8.decoder).transform(const LineSplitter());

Future<List<String>> readLines() async {
  final lines = <String>[];
  await for (var line in lineStream) {
    lines.add(line);
  }
  return lines;
}

void main() async {
  final lines = await readLines();
  final n = int.parse(lines[0]);
  final c = lines[1];
  final charR = 'R'.codeUnitAt(0);
  var red = 0;
  var runes = List.from(c.runes);
  for (var i = 0; i < n; i++) {
    if (runes[i] == charR) {
      red++;
    }
  }
  var count = 0;
  for (var i = 0; i < red; i++) {
    if (runes[i] != charR) {
      count++;
    }
  }
  print('$count');
}