using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _1002
{
	class Program
	{
		int m_N = 0;
		bool[] m_hasBooks = null;
		int[] m_works = new int[3];// 上段、中段、下段

		Program(int N, String chrs)
		{
			m_N = N;
			m_works[0] = 0;
			m_works[1] = int.MaxValue / 2;
			m_works[2] = int.MaxValue / 2;
			m_hasBooks = new bool[(N + 1) * 2];

			// 上段の初期化
			m_hasBooks[0] = chrs[0] == 'Y';
			for (int index = 1; index < N; ++index)
			{
				m_hasBooks[index] =
					chrs[index * 2 - 1] == 'Y' ||
					chrs[index * 2] == 'Y';
			}
			m_hasBooks[N] = chrs[2 * N - 1] == 'Y';

			// 下段の初期化
			m_hasBooks[N + 1] = chrs[2 * N] == 'Y';
			for (int index = 1; index < N; ++index)
			{
				m_hasBooks[index + N + 1] =
					chrs[2 * N + index * 2 - 1] == 'Y' ||
					chrs[2 * N + index * 2] == 'Y';
			}
			m_hasBooks[(N + 1) * 2 - 1] = chrs[4 * N - 1] == 'Y';
		}

		int Run()
		{
			for (int index = 0; index < m_N + 1; ++index)
			{
				int[] nextWorks = { int.MaxValue / 2, int.MaxValue / 2, int.MaxValue / 2};// 上段、中段、下段

				// 上段の候補について
				{
					int cost = m_works[0];
					if (m_hasBooks[index] && !m_hasBooks[m_N + 1 + index])
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 2);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 2);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 3);
					}
					else if (m_hasBooks[index] && m_hasBooks[m_N + 1 + index])
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 4);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 3);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 3);
					}
					else if (!m_hasBooks[index] && m_hasBooks[m_N + 1 + index])
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 4);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 3);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 3);
					}
					else
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 1);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 2);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 3);
					}
				}

				// 中段の候補について
				{
					int cost = m_works[1];
					if (m_hasBooks[index] && !m_hasBooks[m_N + 1 + index])
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 2);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 2);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 3);
					}
					else if (m_hasBooks[index] && m_hasBooks[m_N + 1 + index])
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 3);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 3);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 3);
					}
					else if (!m_hasBooks[index] && m_hasBooks[m_N + 1 + index])
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 3);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 2);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 2);
					}
					else
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 2);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 1);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 2);
					}
				}

				// 下段の候補について
				{
					int cost = m_works[2];
					if (m_hasBooks[index] && !m_hasBooks[m_N + 1 + index])
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 3);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 3);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 4);
					}
					else if (m_hasBooks[index] && m_hasBooks[m_N + 1 + index])
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 3);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 3);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 4);
					}
					else if (!m_hasBooks[index] && m_hasBooks[m_N + 1 + index])
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 3);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 2);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 2);
					}
					else
					{
						nextWorks[0] = Math.Min(nextWorks[0], cost + 3);
						nextWorks[1] = Math.Min(nextWorks[1], cost + 2);
						nextWorks[2] = Math.Min(nextWorks[2], cost + 1);
					}
				}

				m_works = nextWorks;
			}

			return m_works[0] - 1;
		}

		static void Main(string[] args)
		{
			TextReader input = Console.In;
			if (args.Length > 0)
			{
				input = File.OpenText(args[0]);
			}

			input.ReadLine();// 問題数は不要

			string line = null;
			while ((line = input.ReadLine()) != null)
			{
				int N = int.Parse(line);
				String chrs = input.ReadLine();
				Program p = new Program(N, chrs);
				int result = p.Run();

				Console.Out.WriteLine(result);
			}
		}
	}
}

Measured memory_bytes: 5976