using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp7
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            List<string> a = new List<string>();
            for (int i = 0; i < n; i++)
                a.Add(Console.ReadLine());
            int br = a.Count;
            foreach (string x in a)
            {
                for (int i = 0; i < x.Length; i++)
                    if (x[i] == ' ')
                        br = br + 1;
            }
            Console.WriteLine(br);
            Console.ReadKey();
        }
    }
}
