using System;
using System.Linq;
using System.Security.Cryptography;
using System.Collections.Generic;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int br = 0;
            string[] b = Console.ReadLine().Split();
            List<string> a = new List<string>();
            a.Add(b[0]);
            a.Add(b[1]);
            a.Add(b[2]);
            string a1 = "", b1 = "";
            if (b[2] == "S")
            {
                br++;
            }
            for (int j = 1; j < n - 1; j++)
            {
                string[] u = Console.ReadLine().Split();
                a.Add(u[0]);
                a.Add(u[1]);
                a.Add(u[2]);
                if (u[2] == "S")
                {
                    a1 = u[0];
                    b1 = u[1];
                }
            }
            int x = (n - 1) * 3;
            for (int l = 0; l < 1; l += 3)
            {
                br++;
            }
            Console.WriteLine(br + 4);
        }
    }
}