You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a row, the system considers that the file content does not correspond to the social network topic. In this case, the file is not sent and an error message is displayed.Determine the minimum number of characters to remove from the file name so after that the name does not contain "xxx" as a substring. Print 0 if the file name does not initially contain a forbidden substring "xxx".You can delete characters in arbitrary positions (not necessarily consecutive). If you delete a character, then the length of a string is reduced by $$$1$$$. For example, if you delete the character in the position $$$2$$$ from the string "exxxii", then the resulting string is "exxii".

The first line contains integer $$$n$$$ $$$(3 \le n \le 100)$$$ — the length of the file name. The second line contains a string of length $$$n$$$ consisting of lowercase Latin letters only — the file name.

Print the minimum number of characters to remove from the file name so after that the name does not contain "xxx" as a substring. If initially the file name dost not contain a forbidden substring "xxx", print 0.

NoteIn the first example Polycarp tried to send a file with name contains number $$$33$$$, written in Roman numerals. But he can not just send the file, because it name contains three letters "x" in a row. To send the file he needs to remove any one of this letters.

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{

    static void Main(string[] args)
    {

        Console.ReadLine();

        string s = Console.ReadLine();

        bool isX = false;

        int temp = 0;

        int answer = 0;

        char[] str = s.ToCharArray();

        for (int i = 0; i < str.Length; i++)
        {
            if (str[i] == 'x')
            {
                temp++;
            }

            else
            {
                temp = 0;
            }

            if (temp > 2)
            {
                answer++;
            }
        }

        Console.WriteLine(answer);

        //Console.ReadKey();

    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			int count = int.Parse(Console.ReadLine());
			string str = Console.ReadLine()+"0";
			int a = 0, num = 0;
			foreach(char x in str)
			{
				if (x != 'x')
				{
					num += a > 2 ? a - 2 : 0;
					a = 0;
				}
				else
					a++;
			}
			Console.WriteLine(num);
		}
	}
}

using System;
class Program
    {
        static void Main(string[] args)
        {
            string input = Console.In.ReadToEnd().Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries)[1];
            int result = 0;
            for(int i = 0, cntr=0; i<input.Length; cntr=0)
            {
                while (i<input.Length && input[i] != 'x') i++;
                while (i < input.Length && input[i] == 'x') { i++; cntr++; }
                if (cntr > 2) result += cntr - 2;
            }
            Console.WriteLine(result);
        }
    }

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

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            TextReader sr = Console.In;
            int n = Convert.ToInt32(sr.ReadLine());
            string s = sr.ReadLine();
            int lxc = 0;
            int l_ud = 0;
            for (int i = 0; i <= s.Length; i++)
            {
                if (i == s.Length ||  s[i] != 'x')
                {
                    if (lxc > 2)
                    {
                        l_ud = l_ud + (lxc - 2);
                    }
                    lxc = 0;
                }
                else lxc++;
            }
            //вывод решения
            Console.WriteLine(l_ud.ToString());
        }
    }
}

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

namespace Codeforces12
{
    class Program
    {
        static void Main(string[] args)
        {
            int nameLength = Convert.ToInt32(Console.ReadLine());
            string fileName = Console.ReadLine();

            amountToRemove(nameLength, fileName);
        }
        public static void amountToRemove(int nameLength, string fileName)
        {
            //количество стоящих подряд символов х
            int x = 0;
            //количесвто символов для удаления
            int count = 0;

            for (int i = 0; i < nameLength; i++)
            {
                if (fileName[i] == 'x')
                {
                    x++;
                }
                else
                {
                    x = 0;
                }

                if(x > 2)
                {
                    count++;
                }
            }

            Console.WriteLine(count);
            //Console.ReadKey();
        }

    }
}

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

namespace Codeforces12
{
    class Program
    {
        static void Main(string[] args)
        {
            int nameLength = Convert.ToInt32(Console.ReadLine());
            string fileName = Console.ReadLine();
            amountToRemove((fileName));
        }
        public static void amountToRemove(string fileName)
        {
            //количество стоящих подряд символов х
            int x = 0;
            //количесвто символов для удаления
            int count = 0;

            for (int i = 0; i < fileName.Length; i++)
            {
                if (fileName[i] == 'x')
                {
                    x++;
                }
                else
                {
                    x = 0;
                }

                if(x > 2)
                {
                    count++;
                }
            }

            Console.WriteLine(count);
            //Console.ReadKey();
        }

    }
}

using System;
class Program
    {
        static void Main(string[] args)
        {
            string input = Console.In.ReadToEnd().Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries)[1];
            int result = 0;
            for(int i = 0, xes=0; i<input.Length; )
            {
                if (input[i++] == 'x')
                {
                    if (xes > 1) result++;
                    else xes++;
                }
                else xes = 0;
            }
            Console.WriteLine(result);
        }
    }

using System;

namespace codeforces978B
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            char[] s1 = s.ToCharArray();
            long cnt = 0;
            for (int i = 0; i < n- 2; i++)
            {
                if (s1[i] == 'x' && s1[i + 1] == 'x' && s1[i + 2] == 'x')
                    cnt++;

            }
            Console.Write(cnt);
        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;

class Program
{
    public static void Main(string[] args)
    {
        //MulticaseTest();
        //int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int n = int.Parse(Console.ReadLine());
        string s = Console.ReadLine();
        long output = 0;
        int _xxx = 0;
        for (int i = 0; i < s.Length; i++)
        {
            char c = s[i];
            if (c == 'x') _xxx++;
            else _xxx = 0;
            if (_xxx >= 3) output++;
        }
        Console.WriteLine(output);
    }

    public static void MulticaseTest()
    {
        //4
        //4 5 2 3
        int t = int.Parse(Console.ReadLine());
        List<string> o = new List<string>(t);
        for (int i = 0; i < t; i++)
        {
            int n = int.Parse(Console.ReadLine());

        }
        o.ForEach(Console.WriteLine);
    }
}

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

namespace mainnm
{
    class main
    {
        static void Main()
        {
            Console.ReadLine();
            string s = Console.ReadLine();
            //int[] ta = Console.ReadLine().Split(' ').Select(num => int.Parse(num)).ToArray();

            Regex regex = new Regex("xx([x]+)");
            MatchCollection matches = regex.Matches(s);

            int result = 0;
            foreach (Match match in matches) {
                result += match.Groups[0].Value.Length - 2;
            }
            Console.WriteLine(result);
       }
    }
}

using System;

namespace CSharp
{
    public class _978B
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());

            int count = 0;
            int result = 0;

            foreach (var c in Console.ReadLine())
            {
                if (c == 'x')
                {
                    count++;
                }
                else
                {
                    result += Math.Max(0, count - 2);
                    count = 0;
                }
            }

            result += Math.Max(0, count - 2);
            Console.WriteLine(result);
        }
    }
}

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

namespace Contest
{
    class Scanner
    {
        private string[] line = new string[0];
        private int index = 0;
        public string Next()
        {
            if (line.Length <= index)
            {
                line = Console.ReadLine().Split(' ');
                index = 0;
            }
            var res = line[index];
            index++;
            return res;
        }
        public int NextInt()
        {
            return int.Parse(Next());
        }
        public long NextLong()
        {
            return long.Parse(Next());
        }
        public string[] Array()
        {
            line = Console.ReadLine().Split(' ');
            index = line.Length;
            return line;
        }
        public int[] IntArray()
        {
            var array = Array();
            var result = new int[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                result[i] = int.Parse(array[i]);
            }

            return result;
        }
        public long[] LongArray()
        {
            var array = Array();
            var result = new long[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                result[i] = long.Parse(array[i]);
            }

            return result;
        }
    }

    class Program
    {
        private int N;
        private string s;
        private void Scan()
        {
            var sc = new Scanner();
            N = sc.NextInt();
            s = sc.Next();
        }

        public void Solve()
        {
            Scan();
            int ans = 0;
            int cnt = 0;
            foreach (char c in s)
            {
                if (c == 'x')
                {
                    cnt++;
                }
                else
                {
                    ans += Math.Max(0, cnt - 2);
                    cnt = 0;
                }
            }
            ans += Math.Max(0, cnt - 2);
            Console.WriteLine(ans);
        }

        static void Main(string[] args)
        {
            new Program().Solve();
        }
    }
}

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

namespace Solution
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var str = Console.ReadLine();
            var count = 0; var newStr = str.ToString();
            while (newStr.Contains("xxx"))
            {
                newStr = newStr.Replace("xxx", "xx");
            }
            Console.WriteLine(str.Length - newStr.Length);
        }
    }
}

using System;
using System.Linq;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            Solve();
        }

        static void Solve()
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            int count = 0;
            int result = 0;
            for(int i = 0; i < n; i++)
            {
                if (s[i] == 'x') count++;
                else count = 0;
                if (count == 3)
                {
                    count--;
                    result++;
                }
            }
            Console.WriteLine(result);
        }
    }
}

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

namespace dhsmfeh_zhelddmf_gkqslek
{
    public class Priority_Queue<T>
    {
        static List<int[]> priority_queue;

        public Priority_Queue()
        {
            priority_queue = new List<int[]>();
        }

        public void Push(int node, int weight)
        {
            int count = priority_queue.Count();
            int index = -1;

            if(count == 0)
            {
                priority_queue.Add(new int[] { node, weight });
                return;
            }
            for(int i = count; --i > -1;)
            {
                if(priority_queue[i][1] < weight)
                {
                    index = i + 1;
                    break;
                }
            }
            if (index.Equals(-1)) { index = 0; }
            priority_queue.Insert(index, new int[] { node, weight });
        }

        public int Pop()
        {
            int[] arr = priority_queue[0];
            priority_queue.RemoveAt(0);
            return arr[0];
        }

        public int count
        {
            get { return priority_queue.Count(); }
        }

    }
    class Program
    {
        static StringBuilder sb = new StringBuilder();
        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());

            string str = Console.ReadLine();
            int count = 0;
            int answer = 0;
            foreach (var item in str)
            {
                if(item != 'x')
                {
                    answer += (count > 2) ? count - 2 : 0;
                    count = 0;
                }
                else
                {
                    count++;
                }
            }
            answer += (count > 2) ? count - 2 : 0;
            Console.WriteLine(answer);

        }
    }
}

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

namespace Codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string a = Console.ReadLine();
            int k = 0;
            int x = 0;
            bool ist = true;

            k = a.IndexOf("xxx");
            while (k >= 0)
            {
                int i = 1;
                while ((k + 2 + i < a.Length) && a[k + 2 + i] == 'x')
                {
                        i++;

                }
                a = a.Remove(k + 2, i);
                k = a.IndexOf("xxx");
                x += i;
            }
            Console.WriteLine(x);
        }
    }
}

using System;

namespace B_Имя_файла
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var str = Console.ReadLine();
            int answ = 0;
            while (str.Contains("xxx"))
            {
                var pos = str.IndexOf("xxx");
                str=str.Remove(pos, 1);
                answ++;
            }
            Console.WriteLine(answ);
          //  Console.ReadKey();
        }
    }
}

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

namespace codeforces
{
    class Program
    {
        private static string s;
        private static int n;
        private static List<char> a = new List<char>();

        static void Main(string[] args)
        {
            n = int.Parse(Console.ReadLine());
            s = Console.ReadLine();
            int ans = 0;
            for (int i = 0; i < n; ++i)
            {
                if (a.Count >= 2 && a[a.Count - 1] == 'x' && a[a.Count - 2] == 'x' && s[i] == 'x')
                    ans++;
                else
                    a.Add(s[i]);
            }
            Console.WriteLine(ans);
            Console.ReadLine();
        }
    }
}

using System;
using System.Globalization;
using System.IO;
using System.Text;

namespace Olymp
{
  public class ProblemSolver
  {
    private readonly Tokenizer input;

    public void Solve()
    {
      var n = input.ReadInt();
      var s = input.ReadToken();
      var c = 0;
      var k = 0;
      for (int i = 0; i < n; i++)
      {
        if (s[i] == 'x')
          k++;
        else
        {
          if (k > 2)
            c += k - 2;
          k = 0;
        }
      }
      if (k > 2)
        c += k - 2;
      Console.Write(c);
    }

    public ProblemSolver(TextReader input)
    {
      this.input = new Tokenizer(input);
    }
  }

  #region Service classes

  public class Tokenizer
  {
    private TextReader reader;

    public string ReadToEnd()
    {
      return this.reader.ReadToEnd();
    }

    public int ReadInt()
    {
      var c = SkipWS();
      if (c == -1)
        throw new EndOfStreamException();
      var isNegative = false;
      if (c == '-' || c == '+')
      {
        isNegative = c == '-';
        c = this.reader.Read();
        if (c == -1)
          throw new InvalidOperationException();
      }
      if (!char.IsDigit((char)c))
        throw new InvalidOperationException();
      var result = (char)c - '0';
      c = this.reader.Read();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        if (!char.IsDigit((char)c))
          throw new InvalidOperationException();
        result = result * 10 + (char)c - '0';
        c = this.reader.Read();
      }
      if (isNegative)
        result = -result;
      return result;
    }

    public string ReadLine()
    {
      return reader.ReadLine();
    }

    public long ReadLong()
    {
      return long.Parse(this.ReadToken());
    }

    public double ReadDouble()
    {
      return double.Parse(this.ReadToken(), CultureInfo.InvariantCulture);
    }

    public int[] ReadIntArray(int n)
    {
      var a = new int[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadInt();
      return a;
    }

    public long[] ReadLongArray(int n)
    {
      var a = new long[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadLong();
      return a;
    }

    public double[] ReadDoubleArray(int n)
    {
      var a = new double[n];
      for (var i = 0; i < n; i++)
        a[i] = ReadDouble();
      return a;
    }

    public string ReadToken()
    {
      var c = SkipWS();
      if (c == -1)
        return null;
      var sb = new StringBuilder();
      while (c > 0 && !char.IsWhiteSpace((char)c))
      {
        sb.Append((char)c);
        c = this.reader.Read();
      }
      return sb.ToString();
    }

    private int SkipWS()
    {
      var c = this.reader.Read();
      if (c == -1)
        return c;
      while (c > 0 && char.IsWhiteSpace((char)c))
        c = this.reader.Read();
      return c;
    }

    public Tokenizer(TextReader reader)
    {
      this.reader = reader;
    }
  }

  internal class Program
  {
    public static void Main(string[] args)
    {
      var solver = new ProblemSolver(Console.In);
      solver.Solve();
    }
  }

  #endregion
}

using System;

namespace B978
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Convert.ToInt32(Console.ReadLine());
            var s = Console.ReadLine();
            var x = 1;
            var c = 0;
            for (int i = 0; i < n-1; i++)
            {
                var j = i;

                if (s[i]=='x')
                {
                    for (j = i; j < n - 1; j++)
                    {
                        if (s[j] == s[j + 1] && s[j] == 'x')
                        {
                            x++;
                        }
                        else
                        {
                            break;
                        }
                    }
                }

                if (x >= 3)
                {
                    c += x - 2;
                }

                x = 1;

                i = j;
            }

            Console.WriteLine(c);
        }
    }
}

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

namespace NewConsoleApp1
{
    class Program
    {
        static int Check_it(string str)
        {
            int k = 0;
            string temp = "";
            for (int i = 0; i < str.Length; i++)
            {
                if (str[i] == 'x')
                    temp += "x";
                else
                    temp = "";
                if (temp == "xxx")
                {
                    k++;
                    str = str.Remove(i, 1);
                    temp = "";
                    i = 0;
                }
            }
            return k;
        }
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine()), kol = 0;
            string s = Console.ReadLine(), temp = "";
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'x')
                    temp += "x";
                else
                    temp = "";
                if (temp == "xxx")
                {
                    kol++;
                    s = s.Remove(i, 1);
                    n--;
                    temp = "";
                    i = 0;
                }
            }
            kol += Check_it(s);
            Console.WriteLine(kol);
        }
    }
}

using System;
using System.Linq;
using static System.Console;
namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            ReadLine();
            string s = ReadLine();
            int sum = 0;
            for (int i = 0; i < s.Length - 2; i++)
            {
                if (s[i].Equals('x'))
                    if (s[i].Equals(s[i + 1]))
                        if ((s[i + 1].Equals(s[i + 2])))
                            sum++;
            }
            WriteLine(sum);
        }
    }
}

using System;
using System.Collections.Generic;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            String s = Console.ReadLine();
            int cnt = 0;
            List<int> l = new List<int>();
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == 'x')
                {
                    cnt++;
                }
                else
                {
                    if (cnt != 0)
                    {
                        l.Add(cnt);
                        cnt = 0;
                    }
                }
            }
            if (cnt != 0)
            {
                l.Add(cnt);
                cnt = 0;
            }
            int ans = 0;
            for (int i = 0; i < l.Count; i++)
            {
                if (l[i] <= 2)
                {
                    continue;
                }
                ans += l[i] - 2;
            }
            Console.WriteLine(ans);
        }
    }
}

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

namespace Тамик
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            while(s.Contains("xxx"))
            {
                s=s.Replace("xxx","xx");
            }
            Console.WriteLine(n-s.Count());
        }
    }
}

namespace ConsoleApp3
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Collections;
    using System.Linq;

    namespace VectorSpaceModel
    {
        class Program
        {
            static void Main(string[] args)
            {
                //6
                // xxxiii
                var n = int.Parse(Console.ReadLine());
                var a = Console.ReadLine();

                var temp = 0;
                var res = 0;

                for (int i = 0; i < n; i++)
                {
                    if (a[i] == 'x')
                    {
                        temp++;
                        if(temp > 2)
                        {
                            res++;
                        }
                    }
                    else
                    {
                        temp = 0;
                    }
                }

                Console.WriteLine(res);

            }
        }
    }
}

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

namespace TASK_978B
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            string temp = Console.ReadLine();
            int count = 0, result = 0;
            for (int i = 0; i < temp.Length; i++)
            {
                if (temp[i] != 'x')
                    count = 0;
                else
                    count++;
                if (count == 3)
                {
                    result++;
                    count--;
                }
            }
            Console.WriteLine(result);
            Console.ReadLine();
        }
    }
}

using static System.Console;
class a
{
    static void Main()
    {
        ReadLine();
        var a = ReadLine();
        int r = 0;
        for (int i = 0; i < a.Length-2; i++) if (a[i] == 'x' && a[i + 1] == 'x' && a[i + 2] == 'x') r++;
        WriteLine(r);
    }
}

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

namespace Codeforces1305B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            string code;
            code = Console.ReadLine();
            var codeArray = code.ToCharArray();
            int countx = 0;
            List<int> count = new List<int>();

            foreach(var c in codeArray)
            {
                if (c == 'x')
                    countx++;
                else
                {
                    if (countx != 0)
                        count.Add(countx);
                    countx = 0;
                }
            }

            if (countx != 0)
                count.Add(countx);

            int output = 0;

            foreach(var c in count)
            {
                if (c >= 3)
                    output = output + c - 2;
            }

            Console.WriteLine(output);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp
{
    class Program
    {
        static void Main()
        {
            var n = Reader.ReadIntArgs();
            var s = Console.ReadLine();

            int cnt = 0;
            int ans = 0;

            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == 'x')
                {
                    cnt++;
                }
                else
                {
                    ans += cnt > 2 ? cnt - 2 : 0;
                    cnt = 0;
                }
            }

            ans += cnt > 2 ? cnt - 2 : 0;

            Console.WriteLine(ans);
        }

        static bool IsPol(string s)
        {
            int l = 0;
            int r = s.Length - 1;

            while (l < r)
            {
                if (s[l] != s[r])
                    return false;

                l++;
                r--;
            }

            return true;
        }
    }

    static class Reader
    {
        public static List<int> ReadIntArgs()
        {
            return ReadArgs(int.Parse);
        }

        public static List<long> ReadLongArgs()
        {
            return ReadArgs(long.Parse);
        }

        private static List<T> ReadArgs<T>(Func<string, T> parser)
        {
            return Console.ReadLine().Split().Select(parser).ToList();
        }

        public static int ReadIntValue()
        {
            return ReadValue(int.Parse);
        }

        public static long ReadLongValue()
        {
            return ReadValue(long.Parse);
        }

        private static T ReadValue<T>(Func<string, T> parser)
        {
            return parser(Console.ReadLine());
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
             Console.ReadLine();
            string a = Console.ReadLine();
            int sum = 0;
            for (int h = 0; h < 1000; h++)
            {
                for (int i = 0; i < a.Length - 2; i++)
                {
                    if ((a[i] == 'x') && (a[i + 1] == 'x') && (a[i + 2] == 'x'))
                    {
                        sum++;
                        a = a.Remove(i, 1);
                    }
                }
            }
            Console.WriteLine(sum);
                //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using static Template;
using static System.Console;
using static System.Convert;
using static System.Math;
using Pi = Pair<int, int>;

class Solver
{
    public void Solve(Scanner sc)
    {
        var N = sc.Int;
        var s = ReadLine();
        var st = 0;var res = 0;
        for(var i=0;i<N;i++)
            if (s[i] == 'x') { st++; }
        else { res += Max(0,st - 2);st = 0; }
        WriteLine(res+Max(st-2,0));
    }
}

#region Template
public static class Template
{
    static void Main(string[] args)
    {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        new Solver().Solve(new Scanner());
        Console.Out.Flush();
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmin<T>(ref T a, T b) where T : IComparable<T>
    { if (a.CompareTo(b) == 1) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmax<T>(ref T a, T b) where T : IComparable<T>
    { if (a.CompareTo(b) == -1) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(ref T a, ref T b)
    { var t = b; b = a; a = t; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static T[] Create<T>(int n, Func<T> f)
    {
        var rt = new T[n];
        for (var i = 0; i < rt.Length; ++i)
            rt[i] = f();
        return rt;
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static T[] Create<T>(int n, Func<int, T> f)
    {
        var rt = new T[n];
        for (var i = 0; i < rt.Length; ++i)
            rt[i] = f(i);
        return rt;
    }
    public static T[] Copy<T>(this T[] A)
        => Create(A.Length, i => A[i]);
    public static void Fail<T>(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }
}

public class Scanner
{
    public string Str => Console.ReadLine().Trim();
    public int Int => int.Parse(Str);
    public long Long => long.Parse(Str);
    public double Double => double.Parse(Str);
    public int[] ArrInt => Str.Split(' ').Select(int.Parse).ToArray();
    public long[] ArrLong => Str.Split(' ').Select(long.Parse).ToArray();
    public char[][] Grid(int n) => Create(n, () => Str.ToCharArray());
    public int[] ArrInt1D(int n) => Create(n, () => Int);
    public long[] ArrLong1D(int n) => Create(n, () => Long);
    public int[][] ArrInt2D(int n) => Create(n, () => ArrInt);
    public long[][] ArrLong2D(int n) => Create(n, () => ArrLong);
    public Pair<T1, T2> PairMake<T1, T2>() => new Pair<T1, T2>(Next<T1>(), Next<T2>());
    public Pair<T1, T2, T3> PairMake<T1, T2, T3>() => new Pair<T1, T2, T3>(Next<T1>(), Next<T2>(), Next<T3>());
    private Queue<string> q = new Queue<string>();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public T Next<T>() { if (q.Count == 0) foreach (var item in Str.Split(' ')) q.Enqueue(item); return (T)Convert.ChangeType(q.Dequeue(), typeof(T)); }
    public void Make<T1>(out T1 v1) => v1 = Next<T1>();
    public void Make<T1, T2>(out T1 v1, out T2 v2) { v1 = Next<T1>(); v2 = Next<T2>(); }
    public void Make<T1, T2, T3>(out T1 v1, out T2 v2, out T3 v3) { Make(out v1, out v2); v3 = Next<T3>(); }
    public void Make<T1, T2, T3, T4>(out T1 v1, out T2 v2, out T3 v3, out T4 v4) { Make(out v1, out v2, out v3); v4 = Next<T4>(); }
    public void Make<T1, T2, T3, T4, T5>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5) { Make(out v1, out v2, out v3, out v4); v5 = Next<T5>(); }
    public void Make<T1, T2, T3, T4, T5, T6>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6) { Make(out v1, out v2, out v3, out v4, out v5); v6 = Next<T6>(); }
}

public class Pair<T1, T2> : IComparable<Pair<T1, T2>>
{
    public T1 v1;
    public T2 v2;
    public Pair() { }
    public Pair(T1 v1, T2 v2)
    { this.v1 = v1; this.v2 = v2; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2> p)
    {
        var c = Comparer<T1>.Default.Compare(v1, p.v1);
        if (c == 0)
            c = Comparer<T2>.Default.Compare(v2, p.v2);
        return c;
    }
    public override string ToString() => $"{v1.ToString()} {v2.ToString()}";
    public void Tie(out T1 a, out T2 b) { a = v1; b = v2; }
}

public class Pair<T1, T2, T3> : Pair<T1, T2>, IComparable<Pair<T1, T2, T3>>
{
    public T3 v3;
    public Pair() : base() { }
    public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)
    { this.v3 = v3; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2, T3> p)
    {
        var c = base.CompareTo(p);
        if (c == 0)
            c = Comparer<T3>.Default.Compare(v3, p.v3);
        return c;
    }
    public override string ToString() => $"{base.ToString()} {v3.ToString()}";
    public void Tie(out T1 a, out T2 b, out T3 c) { Tie(out a, out b); c = v3; }
}
#endregion

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

namespace B.File_Name
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string x = Console.ReadLine();
            int counter = 0;
            there:
            for (int i = 0; i < x.Length-2; i++)
            {
                if (x[i] == 'x' && x[i + 1] == 'x' && x[i + 2] == 'x')
                {
                    x = x.Remove(i, 1);
                    counter++;
                    goto there;
                }
            }
            Console.WriteLine(counter);
        }
    }
}

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

namespace _978B
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            var len = rl<int>();
            var str = rl<string>();

            var res = 0;
            var row = 0;

            foreach (var ch in str)
            {
                if (ch == 'x')
                {
                    row++;
                }
                else
                {
                    row = 0;
                }

                if (row >= 3)
                {
                    res++;
                }
            }

            wl(res);
        }

        private static T rl<T>() { return (T)Convert.ChangeType(Console.ReadLine(), typeof(T)); }
        private static T[] rla<T>(char sep = ' ') { return Console.ReadLine().Split(sep).Select(s => (T)Convert.ChangeType(s, typeof(T))).ToArray(); }
        private static int[] rlai(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), int.Parse); }
        private static long[] rlal(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), long.Parse); }
        private static string[] rlas(char sep = ' ') { return Console.ReadLine().Split(sep); }
        private static List<T> rll<T>(char sep = ' ') { return Console.ReadLine().Split(sep).Select(s => (T)Convert.ChangeType(s, typeof(T))).ToList(); }
        private static T rn<T>(char sep = ' ') { var b = new StringBuilder(); while (true) { var c = (char)Console.In.Read(); if (c == sep || c == '\n') break; b.Append(c); } return (T)Convert.ChangeType(b.ToString(), typeof(T)); }
        private static void wl(object o) { Console.WriteLine(o); }
        private static void wla(int[] arr, string sep = " ") { Console.WriteLine(string.Join(sep, arr)); }
        private static void wla(long[] arr, string sep = " ") { Console.WriteLine(string.Join(sep, arr)); }
        private static void wla(string[] arr, string sep = " ") { Console.WriteLine(string.Join(sep, arr)); }
        private static void w(object o) { Console.Write(o); }
        private static void wn(object o, string sep = " ") { Console.Write(o + sep); }
    }
}

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

namespace xxx
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Int32.Parse(Console.ReadLine());
            char[] str = new char[n];
            string stroqa;

            stroqa = Console.ReadLine();
            str = stroqa.ToCharArray();
            int result = 0;
            for (int i = 1; i < n-1 ; i++)
            {
                if (str[i - 1] == 'x' && str[i] == str[i - 1] && str[i] == str[i + 1]) result++;
            }
            Console.WriteLine(result);

        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using System.Linq;

namespace Code
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string input = Console.ReadLine();
            int result = 0;
            int counter = 0;

            for (int i = 0; i < input.Length; i++)
            {
                if (input[i] == 'x')
                    counter++;
                else
                    counter = 0;

                if (counter >= 3)
                    result++;
            }

            Console.WriteLine(result);
        }
    }
}

using System;

namespace test
{
    static class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            var str = Console.ReadLine();
            var count = 0;
            for(var i = str.IndexOf("xxx"); i!=-1; i = str.IndexOf("xxx"), count++)
            {
                str = str.Remove(i, 1);
            }
            Console.Write(count);
        }
    }
}

using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            var input = Console.ReadLine();
            var startLength = input.Length;
            while (input.Contains("xxx"))
            {
                input = input.Replace("xxx", "xx");
            }
            Console.WriteLine(startLength-input.Length);
        }
    }
}

using System;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine()), a = 0, t = 0;
            string s = Console.ReadLine();
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'x')
                {
                    t++;
                    if (t > 2)
                        a++;
                }
                else t = 0;
            }
            Console.WriteLine(a);
        }
    }
}

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

namespace Pustoi
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string str = Console.ReadLine();
            int cnt = 0;
            int[] arr = new int[str.Length];
            for(int i = 0; i < str.Length; i++)
            {
                if (str[i].ToString() == "x")
                {
                    cnt += 1;

                }
                else
                {
                    arr[i] = cnt;
                    cnt = 0;
                }
            }
            arr[0] = cnt;
            Array.Sort(arr);
            Array.Reverse(arr);
            int res = 0;
            for (int i = 0; i < arr.Length; i++)
            {
                if (arr[i] >= 3)
                {
                    res += arr[i] - 2;

                }
            }
            Console.WriteLine(res);
            Console.Read();
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace File_Name
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            writer.WriteLine(Solve(args));
            writer.Flush();
        }

        private static int Solve(string[] args)
        {
            string s = reader.ReadLine();
            s = reader.ReadLine();

            int ans = 0;
            int cnt = 0;
            foreach (char c in s)
            {
                if (c == 'x')
                {
                    cnt++;
                    if (cnt > 2)
                        ans++;
                }
                else
                {
                    cnt = 0;
                }
            }

            return ans;
        }
    }
}

using System;

namespace Filenamexxx
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string line = Console.ReadLine();
            int answer = 0;
            for (int i = 2; i < n; i++)
            {
                if(line[i] == 'x')
                {
                    if(line[i-1] == 'x' && line[i-2]== 'x')
                    {
                        answer += 1;
                    }
                }
            }
            Console.WriteLine(answer);
        }
    }
}

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

namespace File_Name
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Int32.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            int count = -2, sum = 0;
            if (s.IndexOf("xxx") == -1)
                Console.WriteLine(0);
            else
            {
                for (int i = 0; i < n;)
                {
                    while (s[i] == 'x')
                    {
                        count++;
                        i++;
                        if (i == n)
                            break;
                    }
                    if (count > 0)
                    {
                        sum += count;
                        count = -2;
                    }
                    else if (count == -2)
                    {
                        i++;
                    }
                    else
                    {
                        count = -2;
                    }

                }
                Console.WriteLine(sum);
            }
            Console.ReadLine();
        }
    }
}

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

namespace ProblemSolving.CodeForces
{
    class File_Name_978_problem_B
    {
        public static void Main(string[] args)
        {
            string st = Console.ReadLine();
            string str = Console.ReadLine();
            string s = "xxx";
            int cnt = 0;
            for(int i = 0; i < str.Length-2; i++)
            {
                if(str.Substring(i, 3).Equals(s))
                {
                    cnt++;
                }
            }
            Console.WriteLine(cnt);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string filename = Console.ReadLine();
            int count = 0;
            while (filename.Contains("xxx"))
            {
                int index = filename.IndexOf("xxx");
                filename = filename.Remove(index, 1);
                count++;
            }
            Console.WriteLine(count);
        }

        static int[] StringToIntArray(string input)
        {
            string[] splitInput = input.Split();
            int length = splitInput.Length;
            int[] result = new int[length];
            for (int i = 0; i < length; i++)
            {
                result[i] = int.Parse(splitInput[i]);
            }
            return result;
        }

        static long[] StringToLongArray(string input)
        {
            string[] splitInput = input.Split();
            int length = splitInput.Length;
            long[] result = new long[length];
            for (int i = 0; i < length; i++)
            {
                result[i] = long.Parse(splitInput[i]);
            }
            return result;
        }
    }
}

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class Test
{

	public static void Main()
	{
		int length = Convert.ToInt32(Console.ReadLine());
		string str = Console.ReadLine();
		int sayac = 0;
		for (int i = 0; i < length; i++)
		{
			if (!str.Contains("xxx"))
			{
				Console.WriteLine("0");
				break;
			}
			else if (i <= (length - 3) && str[i] == 'x' && str[i + 1] == 'x' && str[i + 2] == 'x')
			{
				sayac++;
			}
		}
		if(sayac!=0)Console.WriteLine(sayac);
	}
}

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

namespace file_name
{
    class Program
    {
        static void Main(string[] args)
        {

             int n =int.Parse(Console.ReadLine());
            int b;

                string x = Console.ReadLine();
                 b = 0;
                for (int i = 0; i <n; i++)
                {
                    if (i + 2 <= n - 1)
                    {

                     if (x[i] == 'x' && x[i + 1] == 'x' && x[i + 2] == 'x')
                     {
                          b++;
                      }
                }

            }
            Console.WriteLine(b);

        }
    }
}

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

namespace File_Name
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            string s1 = "";
            int tekBr = 0;
            for (int i = 0; i < n; i++)
            {
                if (s[i] != 'x')
                {
                    s1 += s[i];
                    tekBr = 0;
                }
                else if (s[i] == 'x' && tekBr < 2)
                {
                    s1 += s[i];
                    tekBr++;
                }
            }
            //Console.WriteLine(s1);
            int br = s.Length - s1.Length;
            Console.WriteLine(br);
            Console.ReadLine();
        }
    }
}

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            var filename = Console.ReadLine();

            var delCount = 0;
            var xCount = 0;
            for(var i=0; i< filename.Length; i++)
            {
                if(filename[i] == 'x')
                {
                    xCount++;
                    if(xCount >= 3)
                    {
                        delCount++;
                    }
                }
                else
                {
                    xCount = 0;
                }
            }
            Console.WriteLine(delCount);
        }

    }
}

using System;

namespace FilenameChecker
{
    class Program
    {
        static void Main(string[] args)
        {
            int length = Convert.ToInt32(Console.ReadLine());
            string filename = Console.ReadLine();

            int xCount = 0, removeCharCount = 0;
            for (int i = 0; i < length; i++)
            {
                if (filename[i] == 'x')
                    xCount++;
                else
                    xCount = 0;

                if (xCount > 2)
                    removeCharCount++;
            }

            Console.WriteLine(removeCharCount.ToString());
        }
    }
}

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

namespace File_Name
{
    class Program
    {
        static void Main(string[] args)
        {

            string s=Console.ReadLine();
            string str = Console.ReadLine();
            string sub_str = "xxx";
            int count = 0;
            while(true)
            {
                int i = str.IndexOf(sub_str);
                if (i<0)
                {
                    break;
                }
                str=str.Remove(i, 1);
                count++;
            }
            Console.WriteLine(count);
            //Console.ReadKey();
        }
    }
}

using System;

namespace _2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s1 = Console.ReadLine();
            string s2 = "xxx";
            int i = 0;
            int x = -1;
            int count = -1;
            while (i != -1)
            {
                i = s1.IndexOf(s2, x + 1);
                x = i;
                count++;
            }
            Console.WriteLine(count);
        }
    }
}

using System;

namespace TasksCodeForce
{
	class Program
	{
		static void Main(string[] args)
		{
			int number = int.Parse(Console.ReadLine());
			char[] str = Console.ReadLine().ToCharArray();

			if (number < 3 || number > 100 || str.Length != number)
				return;

			int counter = 0;
			int res = 0;

			for (int i = 0; i < str.Length; i++)
			{
				if (str[i] == 'x')
				{
					counter++;

					if (counter == 3)
					{
						counter -= 1;
						res++;
					}
				}

				else
					counter = 0;
			}

			Console.WriteLine(res);
		}
	}
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using static CF.ReadNext;

namespace CF
{
    public static class Program
    {

        private static void Main()
        {
            var n = NextInt();
            var s = NextWord();
            var consecutiveXs = 0;
            var result = 0;
            foreach (var ch in s)
            {
                if (ch == 'x')
                {
                    consecutiveXs++;
                    if (consecutiveXs >= 3)
                        result++;
                }
                else
                {
                    consecutiveXs = 0;
                }
            }

            Console.WriteLine(result);
        }
    }

    public static class ReadNext
    {
        public static int NextInt()
        {
            var next = ReadUntilSpace();
            return int.Parse(next);
        }

        public static double NextDouble()
        {
            var next = ReadUntilSpace();
            return double.Parse(next);
        }

        public static string NextWord()
        {
            return ReadUntilSpace();
        }

        private static bool IsWhiteSpace(int n)
        {
            return n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1;
        }

        private static string ReadUntilSpace()
        {
            var result = "";

            var n = Console.Read();
            // read whitespace
            while (IsWhiteSpace(n))
            {
                n = Console.Read();
            }

            // read characters
            while (!IsWhiteSpace(n))
            {
                result += (char)n;
                n = Console.Read();
            }

            return result;
        }
    }
}

using System;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        string str = Console.ReadLine();

        int k = 0;
        int value = 0;

        for (int i = 0; i < str.Length; i++)
        {
            if (str[i] == 'x')
            {
                value++;
                if (i == str.Length - 1 && value > 2)
                {
                    k += value - 2;
                    value = 0;
                }
            }
            else
            {
                if (value > 2)
                {
                    k += value - 2;
                }
                value = 0;
            }

        }

        Console.WriteLine(k);
    }
}

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

namespace Practice
{
    public class Program
    {
        public static void Main()
        {
            B978();
            //Console.ReadKey();
        }

        public static void B978()
        {
            int n = int.Parse(Console.ReadLine());
            string line = Console.ReadLine();

            int removed = 0;
            int xLen = 0;
            for(int i = 0; i< n; i++)
            {
                if (line[i] == 'x')
                    xLen++;
                else
                    xLen = 0;

                if (xLen >= 3)
                {
                    removed++;
                    xLen--;
                }
            }
            Console.WriteLine(removed);
        }
        public static void A978()
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = new int[n];
            Boolean[] seen = new Boolean[1001];
            Stack<int> stack = new Stack<int>();

            String[] num = Console.ReadLine().Split();
            for(int i = n-1; i>=0 ; i--)
            {
                int x = int.Parse(num[i]);
                if(!seen[x])
                {
                    stack.Push(x);
                    seen[x] = true;
                }
            }

            StringBuilder output = new StringBuilder();
            output.Append(stack.Count + "\n");

            while (stack.Count != 0)
            {
                output.Append(stack.Pop() + " ");
            }

            Console.WriteLine(output.ToString());

        }
    }

}

using System;
using System.Collections.Generic;
using System.Linq;

namespace algorithms_700_01
{
    class Program
    {
        static void Main(string[] args)
        {
            var occurrenceLength = 0;
            var deletedCount = 0;
            var fileLength = int.Parse(Console.ReadLine());
            for (int i = 0; i < fileLength; i++)
            {
                var letter = (char)Console.Read();
                if (letter != 'x')
                    occurrenceLength = 0;
                else
                    if (occurrenceLength == 2)
                        deletedCount++;
                    else
                        occurrenceLength++;
            }
            Console.WriteLine(deletedCount);
        }
    }
}

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

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            string name = Console.ReadLine();
            int count = 0;
            for (int i = 0; i < name.Length; i++)
            {
                if (name[i] == 'x')
                {
                    int index = i;
                    int xCount = 0;
                    while (index < name.Length && name[index] == 'x')
                    {
                        xCount++;
                        index++;
                    }
                    if (xCount >= 3)
                    {
                        count += xCount - 2;
                    }
                    i = index;
                }
            }
            Console.WriteLine(count);
        }
    }
}

using System;

namespace FileName
{
	class Program
	{
		public static void Main(string[] args)
		{
			int n = Convert.ToInt32(Console.ReadLine().Trim());
			string str = Console.ReadLine().Trim();
			int len =str.Length;
			int cnt = 0;

			while(str.IndexOf("xxx") >= 0) {
				int pos = str.IndexOf("xxx");
				str = str.Remove(pos, 1);
				cnt++;
			}

			Console.WriteLine(cnt);
		}
	}
}

using System;
using System.Linq;

namespace CodeForcesTest
{
    class Program
    {
        static void Main(string[] args)
        {
            int q = Convert.ToInt32(Console.ReadLine()), c = 0;

            string x = Console.ReadLine();

            while(x.IndexOf("xxx") > -1)
            {
                int pos = x.IndexOf("xxx");
                x = x.Remove(pos, 3).Insert(pos, "xx");
                c++;
            }

            Console.WriteLine(c);

            //Console.ReadLine();
        }
    }
}

using System;
class Codeforces_978_B
{
  static void Main()
  {
    int n = int.Parse(Console.ReadLine());
    char [] a = new char [n];
    int cnt = 1; int cntt = 0;
    a[0] = Convert.ToChar(Console.Read());
    for(int i=1; i<n; i++)
    {
        a[i] = Convert.ToChar(Console.Read());
        if(a[i-1]==a[i] && a[i]=='x')
        {
           cnt++;
           if(cnt>=3)
              cntt++;
        }
        else cnt = 1;
    }
    Console.WriteLine();
    Console.WriteLine(cntt);
  }
}

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = int.Parse(Console.ReadLine());
            //int[] a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            string s = Console.ReadLine();
            int count1 = 0;
            int temp = 0;
            for(int i = 0; i < count; i++)
            {
                if (s[i] == 'x')
                {
                    temp++;
                    if (temp == 3)
                    {
                        count1++;
                        temp--;
                    }
                }
                else
                    temp = 0;
            }
            Console.WriteLine(count1);
            Console.ReadLine();

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodeFroces
{
    class Program
    {
        static void Main(string[] args)
        {
            int Len = int.Parse(Console.ReadLine()), count=0,Removed_Char=0;
            string File_Name = Console.ReadLine();
            for(int i = 0; i < Len; ++i)
            {
                if (File_Name[i] == 'x')
                {
                    ++count;
                }
                else if (count > 2)
                {
                    Removed_Char += count - 2;
                    count = 0;
                }
                else count = 0;
            }
            if(count>2)
                Removed_Char += count - 2;
            Console.WriteLine(Removed_Char);

        }
    }
}

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

namespace ConsoleApp11
{
    class Program
    {
        static void Main(string[] args)
        {
            string n = Console.ReadLine();
            string mas = Console.ReadLine();
            List<char> array = mas.ToCharArray().ToList();
            int x = 0;
            for (int i = 0; i < array.Count-2; i++)
            {
                if ((array[i] == array[i+1])&(array[i] == array[i+2])&(array[i]=='x'))
                {
                    x += 1;
                }
            }
            Console.Write(x);

        }
    }
}

using System;

namespace File_Name
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string input = Console.ReadLine();
            int count = 0;
            for (int i = 0; i < input.Length-2; i++)
            {
                if (input[i] == 'x' && input[i + 1] == 'x' && input[i + 2] == 'x')
                    count++;
            }
            Console.WriteLine(count);

        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
           int lenght = int.Parse(Console.ReadLine());

            string input = Console.ReadLine();
            StringBuilder str = new StringBuilder(input);
            int counter = 0;
            while (str.ToString().Contains("xxx"))
            {
                str.Remove(str.ToString().IndexOf("xxx"),1);
                counter++;
            }
            Console.WriteLine(counter);
            Console.ReadLine();
        }
    }
}

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

class Program
{

    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        //var v = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();

        string str = Console.ReadLine();

        int c = 0;

        for (int i = 2; i < n; i++)
        {
            if (str[i - 1] == 'x' && str[i - 2] == 'x' && str[i] == 'x') { c++; }
        }
        Console.WriteLine(c);
        return;
    }

}

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

class program
{
     static int Main()
    {
        int n = int.Parse(Console.ReadLine());
        string input = Console.ReadLine();
        int result = 0;
        int count = 0;
        for (int i = 0; i < input.Length; i++)
        {
            if(input[i]=='x')
            {
                count++;
            }
            else
            {
                if (count>2)
                    result += (count - 2);
                count = 0;
            }

        }
        if(count>2)
            result += (count - 2);
        Console.WriteLine(result);
        return 0;
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace ogaver__
{

    class Program
    {
        static void Main(string[] args)
        {
            //count how many consequtive

            var n = Console.ReadLine();

            var s = Console.ReadLine();

            //get length of all consequtive pieces of x above 2
            var consequtives = new List<int>();
            int part = 0;
            bool recording = false;
            foreach (char c in s)
            {
                if (c == 'x')
                {
                    if (!recording)
                        recording = true;

                    part++;
                }
                else
                {
                    recording = false;
                    if (part > 2)
                        consequtives.Add(part);
                    part = 0;
                }
            }

            if (part > 2)
                consequtives.Add(part);

            int deletes = 0;
            foreach (int nn in consequtives)
                deletes += (nn - 2);

            Console.WriteLine(deletes);
        }

    }
}

using System;

namespace FlightTask
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine()), k =0;
            string messeage = Console.ReadLine();
            for (int i = 0; i < messeage.Length - 2; i++)
            {
                if ((messeage[i] == 'x') && (messeage[i + 1] == 'x') && (messeage[i + 2] == 'x'))
                {
                    k++;
                }
            }
            Console.WriteLine(k);
        }
    }
}

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

namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            while (s.Contains("xxx"))
            {
                s = s.Replace("xxx", "xx");
            }
            Console.WriteLine(n-s.Length);
        }
    }
}
/*
100
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
*/

using System;
using System.Collections.Generic;
using System.Linq;

namespace Codeforces
{
	static class Program
	{

		static void Main(string[] args)
		{
			var n = ReadInt();
			var s = Console.ReadLine();
			if (!s.Contains("xxx"))
			{
				Console.WriteLine(0);
			}
			else
			{
				var ss = s.ToCharArray();
				var c = 0;
				for (int i = 2; i < n; i++)
				{
					if(s[i] == 'x' && s[i - 1] == 'x' && s[i - 2] == 'x')
					{
						c++;
						ss[i] = 'y';
					}
				}
				Console.WriteLine(c);
			}

			Console.ReadLine();
		}
		private static List<long> ReadLongList() => Console.ReadLine().Split().Select(long.Parse).ToList();
		private static List<int> ReadIntList() => Console.ReadLine().Split().Select(int.Parse).ToList();
		private static int[] ReadIntArray() => Console.ReadLine().Split().Select(int.Parse).ToArray();
		private static long[] ReadLongArray() => Console.ReadLine().Split().Select(long.Parse).ToArray();
		private static int ReadInt() => int.Parse(Console.ReadLine());
		private static long ReadLong() => long.Parse(Console.ReadLine());

	}
};

using System;
using System.Text;
using System.Collections.Generic;
using System.Collections;
class Problem
{
    static void Main()
    {
        //--------------------------------input--------------------------------//

        int n = Convert.ToInt32( Console.ReadLine() );
        string str = Console.ReadLine();

        //--------------------------------solve--------------------------------//

        int kq = 0;
        while(str.Contains( "xxx" ))
        {
            int first=str.Length;
            str = str.Replace("xxx","xx");
            kq += ( first - str.Length );
        }
        Console.WriteLine( kq );
    }
}

using System;
using System.Linq;

namespace CodeFirstSimple
{
    class Program
    {
        static void Main()
        {
            Console.ReadLine();
            var str = Console.ReadLine();
            var count = 0;
            var totalCount = 0;
            foreach (var s in str)
            {
                if (s == 'x')
                {
                    count++;
                    if (count >= 3)
                        totalCount++;
                }
                else
                    count = 0;
            }
            Console.WriteLine(totalCount);
        }
    }
}

using System;
using System.Text.RegularExpressions;

class Program
{
    static void Main()
    {
        Console.ReadLine();
        var str = Console.ReadLine();
        Console.WriteLine(str.Length - Regex.Replace(str, "(?<=xx)x", "").Length);
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            string trash = Console.ReadLine();
            string s = Console.ReadLine();
            int K = 0; int temp = 0;
            for (int i=0; i<s.Length;i++)
            {
                if (s[i]=='x') { temp++; }
                else { if (temp>=3) K+= temp-2; temp = 0; }
            }
            if (temp>=3) K += temp - 2; temp = 0;
            if (K <= 0) Console.WriteLine(0);
            else
            Console.WriteLine(K);
        }
    }
}

//#define FILE_INPUT
using System;
using System.Text;
using System.Linq;
//using System.Numerics;
//using System.Collections;
using System.Collections.Generic;
//using System.Collections.Specialized;
//using System.Text.RegularExpressions;

//978A. Удаление дубликатов

namespace CodeForces
{
    class Solution
    {

        private void solve()
        {
            int n = gi(), x = 0, ans = 0;
            cin.NewLine();
            string s = cin.Line();

            foreach (var c in s)
            {
                switch (c)
                {
                    case 'x':
                        x++;
                        break;

                    default:
                        if (x > 2) ans += x - 2;
                        x = 0;
                        break;
                }
            }

            if (x > 2) ans += x - 2;
            Console.WriteLine(ans);
        }

        #region Tools

        static void Main()
        {
            new Solution().solve();
            Pause();
        }

        [System.Diagnostics.Conditional("DEBUG")]
        static private void DebugOut<T>(string format, T arg)
        {
            Console.WriteLine(format, arg);
        }

        [System.Diagnostics.Conditional("DEBUG")]
        static private void DebugOut(string format, params object[] arg)
        {
            Console.WriteLine(format, arg);
        }

        [System.Diagnostics.Conditional("DEBUG")]
        static private void DebugStop()
        {
            Console.ReadKey(true);
        }

        private static T[] ga<T>(int n, Func<int, T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f(i);
            return a;
        }

        private static T[] ga<T>(int n, Func<T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f();
            return a;
        }

        private static int gi()
        { return cin.gi(); }

        private static List<T> gl<T>(int n, Func<int, T> f)
        {
            var a = new List<T>(n + 1);
            for (int i = 0; i < n; ++i) a.Add(f(i));
            return a;
        }

        [System.Diagnostics.Conditional("DEBUG")]
        static private void Pause()
        {
            Console.WriteLine("[debug]");
            Console.ReadKey(true);
        }
        private static void swap<T>(ref T a, ref T b)
        {
            T t = a;
            a = b;
            b = t;
        }

        #endregion Tools
    }

    class cin
    {
        public static int error { get; set; }

        static cin()
        {
#if (ONLINE_JUDGE || !FILE_INPUT)
            reader = new System.IO.BufferedStream(Console.OpenStandardInput(1024 * 10), 1024 * 10);
#else
                reader = new System.IO.BufferedStream((new System.IO.StreamReader("input.txt")).BaseStream, 1024 * 16);
#endif
        }

        public static System.IO.BufferedStream reader { get; private set; }
        public static char Char() { return (char)reader.ReadByte(); }

        public static int gi()
        {
            for (int c = read(); c != -1; c = read())
            {
                switch ((char)c)
                {
                    case '-':
                        return -(int)gu(read());

                    default:
                        if (char.IsDigit((char)c)) return (int)gu(c);
                        break;
                }
            }

            throw new System.IO.IOException();
        }

        public static uint gu()
        {
            return gu(read());
        }

        public static string Line()
        {
            int c;
            StringBuilder sb = new StringBuilder();

            for (c = read(); c != 10 && c != -1; c = read()) sb.Append((char)c);

            if (sb.Length > 0 && sb[sb.Length - 1] == 13) sb.Length -= 1;
            return sb.ToString();
        }

        public static int rawLine(byte[] a, int offset = 0)
        {
            int c, i = offset;
            for (c = reader.ReadByte(); c != 10; c = reader.ReadByte()) a[i++] = (byte)c;
            if (i > 0 && a[i - 1] == 13) i--;
            return i;
        }

        public static int rawLine(char[] a, int offset = 0)
        {
            Array.ConvertAll(a, Convert.ToInt16);

            int c, i = offset;
            for (c = read(); c != 10 && c != -1; c = read()) a[i++] = (char)c;
            if (i > 0 && a[i - 1] == 13) i--;
            return i;
        }

        public static int rawLine<T>(T[] a, Func<int, T> converter) where T : IComparable<int>
        {
            int c, i = 0;
            for (c = read(); c != 10; c = read()) a[i++] = converter(c);
            if (i > 0 && a[i - 1].CompareTo(13) == 0) i--;
            return i;
        }

        public static string Scan()
        {
            int c;
            StringBuilder sb = new StringBuilder();

            do
            {
                c = read();
                if (c == -1) return string.Empty;
            }
            while (c < 33 || c > 126);

            for (; c >= 33 && c <= 126; c = read()) sb.Append((char)c);
            return sb.ToString();
        }

        public static bool Scan(ref StringBuilder sb)
        {
            int c;

            do
            {
                c = read();
                if (c == -1) return false;
            }
            while (c < 33 || c > 126);

            for (; c >= 33 && c <= 126; c = read()) sb.Append((char)c);
            return true;
        }

        private static uint gu(int first)
        {
            int c;
            uint u = (uint)first - '0';
            for (c = read(); c != -1 && char.IsDigit((char)c); c = read())
            {
                u = 10 * u + (uint)c - '0';
            }

            error = c;
            return u;
        }

        private static int read() { return reader.ReadByte(); }

        public static bool NewLine()
        {
            int c = error;
            if (c != 10) do c = reader.ReadByte(); while (c != -1 && c != 10);
            return c != -1;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

class Round
{
    static void Main()
    {
        Console.ReadLine();
        char x = 'x';
        string str = Console.ReadLine();
        int n = str.Length, count = 0, ind = str.IndexOf(x);
        while (ind >= 0)
        {
            int kol=-2;
            while (ind < n && str[ind++] == x) kol++;
            count += (kol > 0) ? kol : 0;
            ind = str.IndexOf(x, ind);
        }
        Console.WriteLine(count);
    }
}

using System;

namespace codeforce
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int p = 0;
            int n = Convert.ToInt32(Console.ReadLine());
            string s = Console.ReadLine();
            for (int i = 0; i < s.Length - 2;i++){
                if(s[i]=='x' && s[i+1]=='x' && s[i+2]=='x'){
                    s = s.Remove(i, 1);
                    p++;
                    i--;
                }
            }
            Console.WriteLine(p);

        }
    }
}

using System;

namespace _2
{
    class Program
    {
        static void Main(string[] args)
        {
            byte n = byte.Parse(Console.ReadLine());

            string s = Console.ReadLine();

            while (s.Contains("xxx"))
            {
                s = s.Remove(s.IndexOf("xxx"), 1);
            }

            Console.WriteLine(n - s.Length);
            Console.Read();
        }
    }
}

using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            int cnt = 0, cnt1 = 0;
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'x')
                {
                    cnt++;
                    if (cnt >= 3)
                        cnt1++;
                }
                if (s[i] != 'x' && cnt != 0)
                    cnt = 0;
            }
            Console.WriteLine(cnt1);
        }
    }
}

using System;
using System.Collections.Generic;

namespace HackerEarthProject
{
    class Program
    {

        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            int count = 0;
            int ch = 0;
            for(int i = 0; i < s.Length; i++)
            {
                if (s[i] != 'x')
                    count = 0;
                if (s[i] == 'x')
                    ++count;
                if (count == 2)
                    continue;
                if (count > 2 && s[i] == 'x')
                    ch++;

            }
            Console.WriteLine(ch);
        }
    }
}

using System;

namespace codeforces978B
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            char[] s1 = s.ToCharArray();
            long cnt = 0;
            for (int i = 0; i < n- 2; i++)
            {
                if (s1[i] == 'x' && s1[i + 1] == 'x' && s1[i + 2] == 'x')
                    cnt++;

            }
            Console.Write(cnt);
        }
    }
}

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

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string name = Console.ReadLine();
            int cnt = 0;
            int i = 0;
            do
            {
                if (name.Substring(i, 3) == "xxx")
                {
                    //name = name.Remove(i, 1);
                    cnt++;
                }

                i++;
            }
            while (i + 3 <= n);

            Console.WriteLine(cnt);
            //Console.ReadLine();
        }
    }
}

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

namespace Problem
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = Convert.ToInt32(Console.ReadLine());
            string title = Console.ReadLine();
            int countX = 0;

            if (title.Contains("xxx"))
            {
                char[] letters = title.ToCharArray();

                for (int n = 2; n < letters.Length; n++)
                {
                    if ((letters[n] == 'x') && (letters[n - 1] == 'x') && (letters[n - 2] == 'x'))
                        countX++;
                }

                Console.WriteLine(countX);
            }

            else
                Console.WriteLine(0);

            Console.ReadLine();
        }
    }
}

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

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			string input2 = Console.ReadLine();

			//var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input2.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();

			int result = 0, count = 0;
			foreach (var i in input2)
			{
				if (i == 'x')
				{
					if (count == 2)
					{
						result++;
					}
					else
					{
						count++;
					}
				}
				else
				{
					count = 0;
				}
			}

			Console.WriteLine(result);
		}

		//private static long GCD(long a, long b)
		//{
		//	long max = Math.Max(a, b);
		//	long min = Math.Min(a, b);

		//	if (min == 0)
		//	{
		//		return max;
		//	}

		//	a = min;
		//	b = max % min;
		//	return GCD(a, b);
		//}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

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

namespace div481
{
    class Program
    {
        static void Main(string[] args)
        {
            int n =Convert.ToInt32( Console.ReadLine());
            string s = Console.ReadLine();
            List<char> l = new List<char>();
            for (int x=0,i = 0; i < n; i++)
            {
                if (s[i] == 'x')
                { if (x != 2) { l.Add(s[i]); x++; } }
                else { l.Add(s[i]); x=0; }
            }
            Console.WriteLine(n-l.Count);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var line = Console.ReadLine();
            var cnt = 0;
            var res = 0;
            for (int i = 0; i < n; i++)
            {
                if (line[i] == 'x')
                    cnt++;
                else
                    cnt = 0;

                if (cnt > 2)
                    res++;
            }

            Console.WriteLine(res);
        }
    }
}

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			var n = Int();
			var s = Console.ReadLine();
			var xs = 0;
			var ans = 0;
			for (int i = 0; i < n; i++)
			{
				if (s[i] == 'x')
					xs++;
				else
				{
					if (xs > 2)
					{
						ans += xs - 2;
					}
					xs = 0;
				}
			}
			if (xs > 2)
			{
				ans += xs - 2;
			}
			Console.WriteLine(ans);

		}

		static int Int()
		{
			return Int32.Parse(Console.ReadLine());
		}

		static (int, int) Int2()
		{
			var arr = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);
			return (arr[0], arr[1]);
		}

		static (int, int, int) Int3()
		{
			var arr = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);
			return (arr[0], arr[1], arr[2]);
		}

		static (int, int, int, int) Int4()
		{
			var arr = Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);
			return (arr[0], arr[1], arr[2], arr[3]);
		}

		static int[] Ints()
		{
			return Array.ConvertAll(Console.ReadLine().Split(' '), Int32.Parse);
		}

		static long Long()
		{
			return Int64.Parse(Console.ReadLine());
		}

		static (long, long) Long2()
		{
			var arr = Array.ConvertAll(Console.ReadLine().Split(' '), Int64.Parse);
			return (arr[0], arr[1]);
		}

		static (long, long, long) Long3()
		{
			var arr = Array.ConvertAll(Console.ReadLine().Split(' '), Int64.Parse);
			return (arr[0], arr[1], arr[2]);
		}

		static (long, long, long, long) Long4()
		{
			var arr = Array.ConvertAll(Console.ReadLine().Split(' '), Int64.Parse);
			return (arr[0], arr[1], arr[2], arr[3]);
		}

		static long[] Longs()
		{
			return Array.ConvertAll(Console.ReadLine().Split(' '), Int64.Parse);
		}
	}

}

using System;
using System.Collections.Generic;

namespace Strings
{
    class Program
    {
        // https://codeforces.com/problemset/problem/236/A
        static void _236A()
        {
            Dictionary<char, int> dict = new Dictionary<char, int>();

            foreach (char letter in Console.ReadLine())
            {
                if (dict.ContainsKey(letter)) dict[letter]++;
                else dict.Add(letter, 1);
            }

            Console.WriteLine(dict.Count % 2 == 1 ? "IGNORE HIM!" : "CHAT WITH HER!");
        }

        // https://codeforces.com/problemset/problem/1397/A
        static void _1397A()
        {
            for (int t = int.Parse(Console.ReadLine()); t > 0; --t)
            {
                Dictionary<char, int> dict = new Dictionary<char, int>();

                int n = int.Parse(Console.ReadLine());

                for (int j = 0; j < n; ++j)
                {
                    foreach (char letter in Console.ReadLine())
                    {
                        if (dict.ContainsKey(letter)) dict[letter]++;
                        else dict.Add(letter, 1);
                    }
                }

                bool no = false;

                foreach (var pair in dict)
                {
                    if (pair.Value % n != 0)
                    {
                        Console.WriteLine("NO");
                        no = true;
                        break;
                    }
                }

                if (!no)
                    Console.WriteLine("YES");
            }
        }

        // https://codeforces.com/problemset/problem/978/B
        static void _978B()
        {
            int n = int.Parse(Console.ReadLine());

            int minToRemove = 0;
            List<(int, int)> substrIndexes = new List<(int, int)>();
            string s = Console.ReadLine();
            int curSubsrtStart = 0;

            for (int i = 0; i < n; ++i)
            {
                if (s[i] == 'x')
                {
                    curSubsrtStart = i;

                    while (i + 1 < n && s[++i] == 'x') ;

                    substrIndexes.Add((curSubsrtStart, i == n - 1 && s[i] == 'x' ? i : i - 1));
                }
            }

            foreach (var indexes in substrIndexes)
            {
                //Console.WriteLine($"({indexes.Item1},{indexes.Item2})");
                if (indexes.Item2 - indexes.Item1 > 1)
                {
                    minToRemove += indexes.Item2 - indexes.Item1 - 1;
                }
            }

            Console.WriteLine(minToRemove);
        }

        static void Main(string[] args)
        {
            _978B();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;
using static System.Console;
using static System.Convert;

//
class ProblemSolver
{
    const string STRINGTOREMOVE = "xxx";
    static void Main(string[] args)
    {
       int inputLen = ToInt32(ReadLine());

       string input = ReadLine();

       if(!string.IsNullOrWhiteSpace(input) && input.Length == inputLen)
       {
           int numberOfCharsToRemove = 0;
           int index = -1;
           while((index = input.IndexOf(STRINGTOREMOVE)) > -1)
           {
               input = input.Remove(index,1);
               numberOfCharsToRemove++;
           }

           Write(numberOfCharsToRemove);
       }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using CodeforcesRound481Div3.Questions;

namespace CodeforcesRound481Div3.Questions
{
    public class QuestionB : AtCoderQuestionBase
    {
        public override void Solve(IOManager io)
        {
            var n = io.ReadInt();
            var s = io.ReadString();

            var streak = 0;
            var removed = 0;

            foreach (var c in s)
            {
                if (c == 'x')
                {
                    streak++;

                    if (streak >= 3)
                    {
                        removed++;
                    }
                }
                else
                {
                    streak = 0;
                }
            }

            io.WriteLine(removed);
        }
    }
}

namespace CodeforcesRound481Div3
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionB();
            using var io = new IOManager(Console.OpenStandardInput(), Console.OpenStandardOutput());
            question.Solve(io);
        }
    }
}

#region Base Class

namespace CodeforcesRound481Div3.Questions
{

    public interface IAtCoderQuestion
    {
        string Solve(string input);
        void Solve(IOManager io);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public string Solve(string input)
        {
            var inputStream = new MemoryStream(Encoding.UTF8.GetBytes(input));
            var outputStream = new MemoryStream();
            using var manager = new IOManager(inputStream, outputStream);

            Solve(manager);
            manager.Flush();

            outputStream.Seek(0, SeekOrigin.Begin);
            var reader = new StreamReader(outputStream);
            return reader.ReadToEnd();
        }

        public abstract void Solve(IOManager io);
    }

    public class IOManager : IDisposable
    {
        private readonly StreamReader _reader;
        private readonly StreamWriter _writer;
        private bool _disposedValue;
        private Queue<ReadOnlyMemory<char>> _stringQueue;

        const char ValidFirstChar = '!';
        const char ValidLastChar = '~';

        public IOManager(Stream input, Stream output)
        {
            _reader = new StreamReader(input);
            _writer = new StreamWriter(output) { AutoFlush = false };
            _stringQueue = new Queue<ReadOnlyMemory<char>>();
        }

        public ReadOnlySpan<char> ReadCharSpan()
        {
            while (_stringQueue.Count == 0)
            {
                var line = _reader.ReadLine().AsMemory().Trim();
                var s = line.Span;

                if (s.Length > 0)
                {
                    var begin = 0;
                    for (int i = 0; i < s.Length; i++)
                    {
                        if (begin < 0 && IsValidChar(s[i]))
                        {
                            begin = i;
                        }
                        else if (!IsValidChar(s[i]))
                        {
                            _stringQueue.Enqueue(line[begin..i]);
                            begin = -1;
                        }
                    }
                    _stringQueue.Enqueue(line[begin..line.Length]);
                }
            }

            return _stringQueue.Dequeue().Span;
        }

        public string ReadString() => ReadCharSpan().ToString();

        public int ReadInt() => (int)ReadLong();

        public long ReadLong()
        {
            long result = 0;
            bool isPositive = true;

            int i = 0;
            var s = ReadCharSpan();
            if (s[i] == '-')
            {
                isPositive = false;
                i++;
            }

            while (i < s.Length)
            {
                result = result * 10 + (s[i++] - '0');
            }

            return isPositive ? result : -result;
        }

        public double ReadDouble() => double.Parse(ReadCharSpan());
        public decimal ReadDecimal() => decimal.Parse(ReadCharSpan());

        public int[] ReadIntArray(int n)
        {
            var a = new int[n];
            for (int i = 0; i < a.Length; i++)
            {
                a[i] = ReadInt();
            }
            return a;
        }

        public long[] ReadLongArray(int n)
        {
            var a = new long[n];
            for (int i = 0; i < a.Length; i++)
            {
                a[i] = ReadLong();
            }
            return a;
        }

        public double[] ReadDoubleArray(int n)
        {
            var a = new double[n];
            for (int i = 0; i < a.Length; i++)
            {
                a[i] = ReadDouble();
            }
            return a;
        }

        public decimal[] ReadDecimalArray(int n)
        {
            var a = new decimal[n];
            for (int i = 0; i < a.Length; i++)
            {
                a[i] = ReadDecimal();
            }
            return a;
        }

        public void WriteLine<T>(T value) => _writer.WriteLine(value.ToString());

        public void WriteLine<T>(IEnumerable<T> values, char separator)
        {
            var e = values.GetEnumerator();
            if (e.MoveNext())
            {
                _writer.Write(e.Current.ToString());

                while (e.MoveNext())
                {
                    _writer.Write(separator);
                    _writer.Write(e.Current.ToString());
                }
            }

            _writer.WriteLine();
        }

        public void Flush() => _writer.Flush();

        private static bool IsValidChar(char c) => ValidFirstChar <= c && c <= ValidLastChar;

        protected virtual void Dispose(bool disposing)
        {
            if (!_disposedValue)
            {
                if (disposing)
                {
                    _reader.Dispose();
                    _writer.Flush();
                    _writer.Dispose();
                }

                _disposedValue = true;
            }
        }

        public void Dispose()
        {
            Dispose(disposing: true);
            GC.SuppressFinalize(this);
        }
    }
}

#endregion

using System;
class Program
{
    static void Main(string[] args)
    {
        var n = Int32.Parse(Console.ReadLine());
        string s = Console.ReadLine();
        int rmvdX = 0, xCnt = 0;
        for (int i = 0; i < s.Length; i++)
        {
            if (s[i] == 'x')
            {
                xCnt++;
                if (xCnt>2) rmvdX++;
            }
            else xCnt = 0;
        }
        Console.WriteLine(rmvdX);
    }
}

using System;

namespace Test123
{
    class Program
    {
        static void Main(string[] args)
        {
            int numberOfChars = Convert.ToInt32(Console.ReadLine());
            string inputString = Console.ReadLine();
            int toRemove = 0;

            for(int i = 0; i < inputString.Length-2; i++)
            {
                string currentString = inputString.Substring(i, 3);
                if(currentString.Contains("xxx"))
                {
                    toRemove++;
                }
            }
            Console.WriteLine(toRemove);
        }
    }
}

using System;

namespace FirstProgram
{
    class FirstProgram
    {
        static void Main(String[] args)
        {
            string s;
            int i, k, t, n, l;
            k = 0;
            t = 0;
            n = Convert.ToInt32(Console.ReadLine());
            s = Console.ReadLine();
            l = s.Length;
            for (i = 0; i < l; i++)
            {
                if (s[i] == 'x')
                    k++;
                else
                    k = 0;
                if (k > 2)
                    t++;
            }
            Console.Write(t);
        }
    }
}

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

namespace A.Anton_and_Polyhedrons
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Int32.Parse(Console.ReadLine());
            string s = Console.ReadLine();

            int cont = 0;
            int sum = 0;
            for (int i = 0; i < n; i++)
            {
                if(s[i] == 'x')
                {
                    cont++;
                }
                else
                {
                    if (cont <= 2)
                    {
                        cont = 0;
                        continue;
                    }
                    cont -= 2;
                    sum +=cont;
                    cont = 0;
                }

            }
            if(cont > 2)
            {
                cont -= 2;
                sum += cont;
                cont = 0;
            }
            Console.WriteLine(sum);
            Console.ReadLine();
        }
    }
}

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

namespace B.Имя_файла
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string str = Console.ReadLine();

            int xMetr = 0, delete = 0;

            for (int i = 0; i < n; i++)
            {
                if (str[i] != 'x')
                {
                    if (xMetr > 2)
                        delete += xMetr - 2;
                    xMetr = 0;
                }
                else
                    xMetr++;
            }

            if (str[n - 1] == 'x' && xMetr > 2)
                delete += xMetr - 2;

            Console.WriteLine(delete);
        }
    }
}

using System;
using System.Linq;

namespace CodeForces
{
    class Program
    {
        static void Main(string[] args)
        {
            Solve();
        }

        static void Solve()
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            int count = 0;
            int result = 0;
            for(int i = 0; i < n; i++)
            {
                if (s[i] == 'x') count++;
                else if(count >= 3)
                {
                    result += count - 2;
                    count = 0;
                }
            }
            if (count >= 3) result += count - 2;
            Console.WriteLine(result);
        }
    }
}

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

namespace Codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string a = Console.ReadLine();
            int k = 0;
            int x = 0;
            bool ist = true;

            k = a.IndexOf("xxx");
            while (k >= 0)
            {
                int i = 1;
                while ((k + 3 + i < a.Length) && a[k + 3 + i] == 'x')
                {
                        i++;

                }
                a = a.Remove(k + 2, i);
                k = a.IndexOf("xxx");
                x += i;
            }
            Console.WriteLine(x);
        }
    }
}

using System;

namespace B978
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Convert.ToInt32(Console.ReadLine());
            var s = Console.ReadLine();
            var x = 1;
            var c = 0;
            for (int i = 0; i < n-1; i++)
            {
                var j = i;

                if (s[i]=='x')
                {
                    for (j = i; j < n - 1; j++)
                    {
                        if (s[j] == s[j + 1] && s[j] == 'x')
                        {
                            x++;
                        }
                        else
                        {
                            break;
                        }
                    }
                }

                if (x >= 3)
                {
                    c += x - 2;
                }

                x = 1;

                if (j==n-1)
                {
                    break;
                }
            }

            Console.WriteLine(c);
        }
    }
}

using System;

namespace B978
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Convert.ToInt32(Console.ReadLine());
            var s = Console.ReadLine();
            var x = 0;
            var c = 0;
            for (int i = 0; i < n-1; i++)
            {
                var j = i;
                while (s[j]==s[j+1] && s[j] == 'x' )
                {
                    x++;
                    if (j == n - 2 && s[n - 1] == 'x' && x >= 3)
                        x++;
                        if (j == n - 2)
                        break;
                    j++;
                }

                if (x >= 3)
                {
                    c += x-2;
                    x = 0;
                }
                if (j == n - 2)
                    break;
            }

            Console.WriteLine(c);
        }
    }
}

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

namespace ConsoleApp125
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine()), kolvo = 0;
            bool End = true;
            string s = Console.ReadLine(), temp = "" ;
            for(int i = 0; i < n; i++)
            {
                if (temp == "xxx")
                {
                    End = false;
                    break;
                }
                if (s[i] == 'x')
                    temp += s[i];
                else
                    temp = "";
            }
            if (End == false)
            {
                temp = "";
                for (int i = 0; i < s.Length; i++)
                {
                    if (s[i] == 'x')
                        temp += s[i];
                    else
                        temp = "";
                    if (temp == "xxx")
                    {
                        s = s.Remove(i, 1);
                        i = -1;
                        temp = "";
                        kolvo++;
                    }
                }
                Console.WriteLine(kolvo);
            }
            else
                Console.WriteLine(0);
        }
    }
}

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

namespace Codeforces1305B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            string code;
            code = Console.ReadLine();
            var codeArray = code.ToCharArray();
            int countx = 0;
            int max = 0;
            foreach(var c in codeArray)
            {
                if (c == 'x')
                    countx++;
                else
                    countx = 0;

                if(max<countx)
                {
                    max = countx;
                }
            }

            if (max < 3)
                Console.WriteLine(0);
            else
                Console.WriteLine(max - 2);
        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;

namespace AlgoTasks
{
    class Program
    {
        static void Main(string[] args)
        {
            //---------------------------------------------------------------------
            int n = int.Parse(Console.ReadLine());
            string str = Console.ReadLine();
            int max = 0;
            int c = 0;
            for (int i = 0; i < n; i++)
            {
                if (str[i] == 'x')
                {
                    c++;
                    if (c > max) max = c;
                }
                else
                {
                    c = 0;
                }
            }
            if (max >= 3)
                Console.WriteLine(max - 2);
            else
                Console.WriteLine(0);
            //---------------------------------------------------------------------
            /*int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            //5
            //1 2 4 5 10
            //2 2 4 5 10

            //1 1 3 5 9
            int i = 1;
            while (i <= a.Max())
            {
                for (int j = 0; j < n; j++)
                {
                    if (i == a[j] && i % 2 == 1)
                        a[j] = i + 1;
                    else if (i == a[j] && i % 2 == 0)
                        a[j] = i - 1;
                }

                int min = a[0];
                for (int k = 1; k < n; k++)
                {
                    if (min < a[k] && a[k] > i)
                        min = a[k];
                }
                i = min;
            }

            foreach (var item in a)
            {
                Console.Write(item + " ");
            }*/
            //---------------------------------------------------------------------
            /*int n = int.Parse(Console.ReadLine());
            int[] x = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

            //5
            //3 10 8 6 11
            //4
            //1
            //10
            //3
            //11

            //0
            //4
            //1
            //5

            x = new SortedSet<int>(x).ToArray();
            int maxPrice = x[n - 1];
            n = x.Length;
            int[] dp = new int[maxPrice + 1];
            int c = 1;
            for (int i = 0; i < n; i++)
                dp[x[i]] = c++;

            for (int i = 1; i <= maxPrice; i++)
                dp[i] = Math.Max(dp[i], dp[i - 1]);

            int q = int.Parse(Console.ReadLine());
            for (int i = 0; i < q; i++)
            {
                long m = long.Parse(Console.ReadLine());
                if (m >= maxPrice)
                    Console.WriteLine(dp[maxPrice]);
                else
                    Console.WriteLine(dp[m]);
            }*/
            //---------------------------------------------------------------------
        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;

namespace AlgoTasks
{
    class Program
    {
        static void Main(string[] args)
        {
            //---------------------------------------------------------------------
            int n = int.Parse(Console.ReadLine());
            string str = Console.ReadLine();
            int c = 0;
            int toDelete = 0;
            for (int i = 0; i < n; i++)
            {
                if (str[i] == 'x')
                    c++;
                else
                {
                    if (c >= 3)
                    {
                        toDelete += c - 2;
                    }

                    c = 0;
                }
            }
            Console.WriteLine(toDelete);
            //---------------------------------------------------------------------
            /*int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            //5
            //1 2 4 5 10
            //2 2 4 5 10

            //1 1 3 5 9
            int i = 1;
            while (i <= a.Max())
            {
                for (int j = 0; j < n; j++)
                {
                    if (i == a[j] && i % 2 == 1)
                        a[j] = i + 1;
                    else if (i == a[j] && i % 2 == 0)
                        a[j] = i - 1;
                }

                int min = a[0];
                for (int k = 1; k < n; k++)
                {
                    if (min < a[k] && a[k] > i)
                        min = a[k];
                }
                i = min;
            }

            foreach (var item in a)
            {
                Console.Write(item + " ");
            }*/
            //---------------------------------------------------------------------
            /*int n = int.Parse(Console.ReadLine());
            int[] x = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

            //5
            //3 10 8 6 11
            //4
            //1
            //10
            //3
            //11

            //0
            //4
            //1
            //5

            x = new SortedSet<int>(x).ToArray();
            int maxPrice = x[n - 1];
            n = x.Length;
            int[] dp = new int[maxPrice + 1];
            int c = 1;
            for (int i = 0; i < n; i++)
                dp[x[i]] = c++;

            for (int i = 1; i <= maxPrice; i++)
                dp[i] = Math.Max(dp[i], dp[i - 1]);

            int q = int.Parse(Console.ReadLine());
            for (int i = 0; i < q; i++)
            {
                long m = long.Parse(Console.ReadLine());
                if (m >= maxPrice)
                    Console.WriteLine(dp[maxPrice]);
                else
                    Console.WriteLine(dp[m]);
            }*/
            //---------------------------------------------------------------------
        }
    }
}

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

namespace Pustoi
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            string str = Console.ReadLine();
            int cnt = 0;
            int[] arr = new int[str.Length];
            for(int i = 0; i < str.Length; i++)
            {
                if (str[i].ToString() == "x")
                {
                    cnt += 1;
                    arr[i] = cnt;
                }
                else
                {
                    arr[i] = cnt;
                    cnt = 0;
                }
            }
            Array.Sort(arr);
            Array.Reverse(arr);
            if (arr[0] >= 3)
            {
                Console.WriteLine(arr[0]-2);

            }
            else
            {
                Console.WriteLine(0);
            }
            Console.Read();
        }
    }
}

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class Test
{

	public static void Main()
	{
		int length = Convert.ToInt32(Console.ReadLine());
		string str = Console.ReadLine();
		int sayac = 0;
		for (int i = 0; i < length; i++)
		{
			if (!str.Contains("xxx"))
			{
				Console.WriteLine("0");
				break;
			}
			else if (i <= (length - 3) && str[i] == 'x' && str[i + 1] == 'x' && str[i + 2] == 'x')
			{
				sayac++;
			}
		}
		Console.WriteLine(sayac);
	}
}

using System;

namespace FileName
{
	class Program
	{
		public static void Main(string[] args)
		{
			int n = Convert.ToInt32(Console.ReadLine().Trim());
			string str = Console.ReadLine().Trim();
			int len =str.Length;
			int cnt = 0;

			while(str.IndexOf("xxx") >= 0) {
				str = str.Replace("xxx", "xx");
				cnt++;
			}

			Console.WriteLine(cnt);
		}
	}
}

using System;

namespace File_Name
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int count = 0;
            for (int i = 0; i < input.Length-2; i++)
            {
                if (input[i] == 'x' && input[i + 1] == 'x' && input[i + 2] == 'x')
                    count++;
            }
            Console.WriteLine(count);

        }
    }
}

using System;

namespace File_Name
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int count = 0;
            for (int i = 0; i < input.Length; i++)
            {
                if (input[i] == 'x' && input[i + 1] == 'x' && input[i + 2] == 'x')
                    count++;
            }
            Console.WriteLine(count);

        }
    }
}

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

class program
{
     static int Main()
    {
        int n = int.Parse(Console.ReadLine());
        string input = Console.ReadLine();
        int result = 0;
        int count = 0;
        for (int i = 0; i < input.Length; i++)
        {
            if(input[i]=='x')
            {
                count++;
            }
            else if(count>0)
            {
                result += (count - 2);
                count = 0;
            }
        }
        if(count>2)
            result += (count - 2);
        Console.WriteLine(result);
        return 0;
    }
}

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

class program
{
     static int Main()
    {
        int n = int.Parse(Console.ReadLine());
        string input = Console.ReadLine();
        int result = 0;
        int count = 0;
        for (int i = 0; i < input.Length; i++)
        {
            if(input[i]=='x')
            {
                count++;
            }
            else if(count>2)
            {
                result += (count - 2);
                count = 0;
            }
        }
        if(count>2)
            result += (count - 2);
        Console.WriteLine(result);
        return 0;
    }
}

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

class program
{
     static int Main()
    {
        int n = int.Parse(Console.ReadLine());
        string input = Console.ReadLine();
        int result = 0;
        int count = 0;
        for (int i = 0; i < input.Length; i++)
        {
            if(input[i]=='x')
            {
                count++;
            }
            else if(count>0)
            {
                result += (count - 2);
                count = 0;
            }
        }
        if(count>0)
            result += (count - 2);
        Console.WriteLine(result);
        return 0;
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            string trash = Console.ReadLine();
            string s = Console.ReadLine();
            int K = 0; int temp = 0;
            for (int i=0; i<s.Length;i++)
            {
                if (s[i]=='x') { temp++; }
                else { if (K < temp) K = temp-2; temp = 0; }
            }
            if (K < temp) K = temp - 2; temp = 0;
            if (K <= 0) Console.WriteLine(0);
            else
            Console.WriteLine(K);
        }
    }
}

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            string trash = Console.ReadLine();
            string s = Console.ReadLine();
            int K = 0; int temp = 0;
            for (int i=0; i<s.Length;i++)
            {
                if (s[i]=='x') { temp++; }
                else { if (temp>=3) K+= temp-2; temp = 0; }
            }
            if (temp>=3) K = temp - 2; temp = 0;
            if (K <= 0) Console.WriteLine(0);
            else
            Console.WriteLine(K);
        }
    }
}

using System;
using System.Collections.Generic;

namespace Strings
{
    class Program
    {
        // https://codeforces.com/problemset/problem/236/A
        static void _236A()
        {
            Dictionary<char, int> dict = new Dictionary<char, int>();

            foreach (char letter in Console.ReadLine())
            {
                if (dict.ContainsKey(letter)) dict[letter]++;
                else dict.Add(letter, 1);
            }

            Console.WriteLine(dict.Count % 2 == 1 ? "IGNORE HIM!" : "CHAT WITH HER!");
        }

        // https://codeforces.com/problemset/problem/1397/A
        static void _1397A()
        {
            for (int t = int.Parse(Console.ReadLine()); t > 0; --t)
            {
                Dictionary<char, int> dict = new Dictionary<char, int>();

                int n = int.Parse(Console.ReadLine());

                for (int j = 0; j < n; ++j)
                {
                    foreach (char letter in Console.ReadLine())
                    {
                        if (dict.ContainsKey(letter)) dict[letter]++;
                        else dict.Add(letter, 1);
                    }
                }

                bool no = false;

                foreach (var pair in dict)
                {
                    if (pair.Value % n != 0)
                    {
                        Console.WriteLine("NO");
                        no = true;
                        break;
                    }
                }

                if (!no)
                    Console.WriteLine("YES");
            }
        }

        // https://codeforces.com/problemset/problem/978/B
        static void _978B()
        {
            int n = int.Parse(Console.ReadLine());

            int minToRemove = 0;
            List<(int, int)> substrIndexes = new List<(int, int)>();
            bool inXSubstr = false;
            string s = Console.ReadLine();
            int curSubsrtStart = 0;

            for (int i = 0; i < n; ++i)
            {
                if (s[i] == 'x')
                {
                    if (!inXSubstr)
                    {
                        inXSubstr = true;
                        curSubsrtStart = i;
                    }

                    while (i + 1 < n && s[++i] == 'x') ;

                    inXSubstr = false;

                    substrIndexes.Add((curSubsrtStart, i == n - 1 ? i : i - 1));
                }
            }

            foreach (var indexes in substrIndexes)
            {
                if (indexes.Item2 - indexes.Item1 > 1)
                {
                    minToRemove += indexes.Item2 - indexes.Item1 - 1;
                }
            }

            Console.WriteLine(minToRemove);
        }

        static void Main(string[] args)
        {
            _978B();
        }
    }
}

using System;

namespace Test123
{
    class Program
    {
        static void Main(string[] args)
        {
            int numberOfChars = Convert.ToInt32(Console.ReadLine());
            string inputString = Console.ReadLine();
            int toRemove = 0;

            Console.WriteLine(inputString);
            for(int i = 0; i < inputString.Length-2; i++)
            {
                string currentString = inputString.Substring(i, 3);
                Console.WriteLine(currentString);
                if(currentString.Contains("xxx"))
                {
                    toRemove++;
                }
            }
            Console.WriteLine(toRemove);
        }
    }
}