using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using System.Text;
using System;
using System.Numerics;

static class SolutionTemplate
{
    static long modPow(long v, long p, long mod)
    {
        if (p == 0)
            return 1;
        if (p == 1)
            return v;

        long add = 1;
        while (p > 1)
        {
            if (p % 2 == 1)
            {
                add *= v;
                add %= mod;
            }
            v = (v * v) % mod;
            p = p / 2;
        }
        return (v * add) % mod;
    }

    public static List<T> GetOrAddNew<K, T>(this Dictionary<K, List<T>> dic, K key)
    {
        if (dic == null) throw new ArgumentNullException();

        return (dic[key] = dic.ContainsKey(key) ? dic[key] : new List<T>());
    }

    public static V GetValueOrDefault<K, V>(this Dictionary<K, V> dic, K key)
    {
        if (dic == null) throw new ArgumentNullException();
        if (dic.ContainsKey(key))
            return dic[key];
        return default(V);

    }

    public static void AddOrSet<K>(this Dictionary<K, long> dic, K key, long add)
    {
        if (dic == null) throw new ArgumentNullException();

        dic[key] = dic.GetValueOrDefault(key) + add;
    }

    public static void AddOrSet<K>(this Dictionary<K, int> dic, K key, int add)
    {
        if (dic == null) throw new ArgumentNullException();

        dic[key] = dic.GetValueOrDefault(key) + add;
    }

    public static void AddOrSetRemove<K>(this Dictionary<K, long> dic, K key, long add)
    {
        if (dic == null) throw new ArgumentNullException();

        dic[key] = dic.GetValueOrDefault(key) + add;

        if (dic[key] == 0)
        {
            dic.Remove(key);
        }
    }

    public static void AddOrSetRemove<K>(this Dictionary<K, int> dic, K key, int add)
    {
        if (dic == null) throw new ArgumentNullException();

        dic[key] = dic.GetValueOrDefault(key) + add;

        if (dic[key] == 0)
        {
            dic.Remove(key);
        }
    }

    public static void RemoveKeyWhen<K, V>(this Dictionary<K, V> dic, K key, V val)
    {
        if (dic == null) throw new ArgumentNullException();

        if (dic.ContainsKey(key) && object.Equals(dic[key], val))
        {
            dic.Remove(key);
        }
    }

    public static void RemoveAllWhen<K, V>(this Dictionary<K, V> dic, V val)
    {
        if (dic == null) throw new ArgumentNullException();

        var keys = dic.Keys.ToList();
        foreach (var item in keys)
        {
            if (object.Equals(dic[item], val))
            {
                dic.Remove(item);
            }
        }
    }

    public static Dictionary<T, int> ToCountDictionary<T>(this IEnumerable<T> enm)
    {
        return enm.GroupBy(el => el).ToDictionary(k => k.Key, val => val.Count());
    }

    public static Dictionary<T, int> ToIndexDictionary<T>(this IEnumerable<T> enm)
    {
        return enm.Select((el, i) => new { val = el, index = i }).ToDictionary(key => key.val, val => val.index);
    }

    public static Dictionary<T, List<int>> ToIndiciesDictionary<T>(this IEnumerable<T> enm)
    {
        return enm.Select((el, i) => new { val = el, index = i }).GroupBy(el => el.val).
            ToDictionary(key => key.Key, val => val.Select(v => v.index).ToList());
    }

    static long readLong()
    {
        return long.Parse(Console.ReadLine().Trim());
    }

    static int readInt()
    {
        return int.Parse(Console.ReadLine().Trim());
    }

    static double readDouble()
    {
        return double.Parse(Console.ReadLine().Trim());
    }

    static long[] readLongs()
    {
        return Array.ConvertAll(Console.ReadLine().Trim().Split(), long.Parse);
    }

    static int[] readInts(int add = 0)
    {
        return Array.ConvertAll(Console.ReadLine().Trim().Split(), el => int.Parse(el) + add);
    }

    static string[] readStrings()
    {
        return Console.ReadLine().Trim().Split();
    }

    static string readString()
    {
        return Console.ReadLine().Trim();
    }

    public static int readInt(this StreamReader str)
    {
        if (str == null) throw new ArgumentNullException();
        return int.Parse(str.ReadLine().Trim());
    }

    public static int[] readInts(this StreamReader str)
    {
        if (str == null) throw new ArgumentNullException();
        return Array.ConvertAll(str.ReadLine().Trim().Split(), int.Parse);
    }

    static StringBuilder WriteArray(StringBuilder sb, IEnumerable lst, string delimeter)
    {
        if (lst == null)
            throw new ArgumentNullException(nameof(lst));
        if (sb == null)
            throw new ArgumentNullException(nameof(sb));

        foreach (var el in lst)
        {
            sb.Append(el);
            if (delimeter != null)
                sb.Append(delimeter);
        }
        return sb;
    }

    static StringBuilder WriteObject(StringBuilder sb, object obj, string delimeter)
    {
        if (obj == null)
            throw new ArgumentNullException(nameof(obj));
        if (sb == null)
            throw new ArgumentNullException(nameof(sb));

        sb.Append(obj);
        if (delimeter != null)
            sb.Append(delimeter);
        return sb;
    }

    static void Write2DimArr<T>(this T[,] arr, string delimeter = " ", string delimeter2 = "\n")
    {
        if (arr == null)
            throw new ArgumentNullException(nameof(arr));

        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < arr.GetLength(0); i++)
        {
            for (int j = 0; j < arr.GetLength(1); j++)
            {
                WriteObject(sb, arr[i, j], delimeter);
            }
            sb.Append(delimeter2);
        }
        Console.Write(sb.ToString());
    }

    static void Write(this object obj, string delimeter = " ")
    {
        if (obj == null)
            throw new ArgumentNullException(nameof(obj));

        var enm = obj as IEnumerable;
        StringBuilder sb = new StringBuilder();
        if (enm != null)
            WriteArray(sb, enm, delimeter);
        else
        {
            WriteObject(sb, obj, delimeter);
        }
        Console.Write(sb.ToString());
    }
    static void WriteLine(this object obj, string delimeter = " ")
    {
        obj.Write(delimeter);
        Console.WriteLine();
    }
    static void WriteS(params object[] obj)
    {
        obj.Write(" ");
    }
    static void WriteLineS(params object[] obj)
    {
        obj.WriteLine(" ");
    }

    static bool isLess(string cur, string str)
    {
        if (cur.Length > str.Length)
            return false;

        if (cur.Length < str.Length)
            return true;

        for (int i = 0; i < cur.Length; i++)
        {
            var curd = (int)char.GetNumericValue(cur[i]);
            var strd = (int)char.GetNumericValue(str[i]);
            if (curd < strd)
                return true;
            if (curd > strd)
                return false;
        }
        return false;
    }

    static List<long> factorial(long n, long m)
    {
        var ret = new long[n + 1];
        ret[0] = 1;
        for (long i = 1; i < n + 1; i++)
        {
            ret[i] = (ret[i - 1] * i) % m;
        }
        return ret.ToList();

    }

    private static int GetAfter(int c, List<int> lst)
    {
        var l = -1;
        var r = lst.Count;

        while (r - l > 1)
        {
            var cur = (r + l) / 2;

            if (lst[cur] <= c)
            {
                l = cur;
            }
            else
            {
                r = cur;
            }
        }
        return r;

    }

    private static string GoogleString(int t, string add)
    {
        return string.Format("Case #{0}: {1}", t, add);
    }

    private static int getPow(long v)
    {
        var cnt = 0;
        while (v > 0)
        {
            cnt++;
            v = v >> 1;
        }
        return cnt;
    }

    private static int getSteps(long v, long target)
    {
        if (target > v)
            throw new Exception();
        var cnt = 0;
        while (v > target)
        {
            cnt++;
            v = v >> 1;
        }
        return cnt;
    }

    static int findLcaLen(int[,] sparse, int[] levels, int v1, int v2, int m)
    {
        if (levels[v1] < levels[v2])
        {
            var tmp = v1;
            v1 = v2;
            v2 = tmp;
        }
        int len = 0;
        for (int i = m; i >= 0; i--)
        {
            if (levels[sparse[v1, i]] >= levels[v2])
            {
                len += (1 << i);
                v1 = sparse[v1, i];
            }
        }
        if (v1 == v2) return len;

        for (int i = m; i >= 0; i--)
        {
            if (sparse[v1, i] != sparse[v2, i])
            {
                v1 = sparse[v1, i];
                v2 = sparse[v2, i];
                len += (1 << (i + 1));
            }
        }
        return len + 2;

    }

    private static int greater(List<int> lst, int vl)
    {
        int l = -1;
        int r = lst.Count;
        while (r - l > 1)
        {
            var cur = (r + l) / 2;
            if (lst[cur] <= vl)
            {
                l = cur;
            }
            else
            {
                r = cur;
            }
        }
        return r;
    }

    public class Heap<T> where T : IComparable<T>
    {
        List<T> arr;
        bool isMax;

        public Heap(int n, bool isMax = true)
        {
            this.isMax = isMax;
            arr = new List<T>(n);
        }

        public Heap(bool isMax = true)
        {
            this.isMax = isMax;
            arr = new List<T>();
        }

        private void Heapify(int i)
        {
            var ch1 = 2 * i + 1;
            var ch2 = 2 * i + 2;

            if (isMax)
            {
                if (ch2 < arr.Count)
                {
                    if (arr[ch2].CompareTo(arr[ch1]) < 0)
                    {
                        if (arr[i].CompareTo(arr[ch1]) < 0)
                        {
                            Swap(i, ch1);
                            Heapify(ch1);
                        }
                    }
                    else // arr[ch2] <= arr[ch1]
                    {
                        if (arr[i].CompareTo(arr[ch2]) < 0)
                        {
                            Swap(i, ch2);
                            Heapify(ch2);
                        }
                    }
                }
                else if (ch1 < arr.Count && arr[ch1].CompareTo(arr[i]) > 0)
                {
                    Swap(i, ch1);
                    Heapify(ch1);
                }
            }
            else
            {
                if (ch2 < arr.Count)
                {
                    if (arr[ch2].CompareTo(arr[ch1]) > 0)
                    {
                        if (arr[i].CompareTo(arr[ch1]) > 0)
                        {
                            Swap(i, ch1);
                            Heapify(ch1);
                        }
                    }
                    else // arr[ch2] <= arr[ch1]
                    {
                        if (arr[i].CompareTo(arr[ch2]) > 0)
                        {
                            Swap(i, ch2);
                            Heapify(ch2);
                        }
                    }
                }
                else if (ch1 < arr.Count && arr[ch1].CompareTo(arr[i]) < 0)
                {
                    Swap(i, ch1);
                    Heapify(ch1);
                }
            }
        }

        public T Pop()
        {
            if (arr.Count < 1)
                throw new Exception("Extracting min from empty heap");
            var min = arr[0];
            arr[0] = arr[arr.Count - 1];
            arr.RemoveAt(arr.Count - 1);
            Heapify(0);
            return min;
        }

        public T Peek()
        {
            if (arr.Count < 1)
                throw new Exception("Extracting min from empty heap");
            var min = arr[0];
            return min;
        }

        public int Count()
        {
            return arr.Count;
        }

        public void Add(T val)
        {
            if (val == null)
                throw new ArgumentNullException();
            arr.Add(val);
            Up(arr.Count - 1);
        }

        private void Up(int i)
        {
            while (i > 0)
            {
                var next = (i - 1) / 2;
                if (isMax)
                {
                    if (arr[next].CompareTo(arr[i]) < 0)
                    {
                        Swap(i, next);
                        i = next;
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    if (arr[next].CompareTo(arr[i]) > 0)
                    {
                        Swap(i, next);
                        i = next;
                    }
                    else
                    {
                        break;
                    }
                }
            }
        }

        private void Swap(int i, int j)
        {
            var tmp = arr[i];
            arr[i] = arr[j];
            arr[j] = tmp;
        }
    }

    class Item : IComparable<Item>
    {
        public int Id;
        public int Value;
        public long Cnt;

        public int CompareTo(Item other)
        {
            return this.Value - other.Value;
        }

        public int CompareTo(object other)
        {
            return CompareTo((int)other);
        }

    }

    private static void Main(string[] args)
    {
        var n = readInt();
        var str = readString();

        int cnt = 0;
        var lst = str.Distinct().OrderByDescending(el => el).ToList();
        for (int i = 0; i < lst.Count; i++)
        {
            var el = lst[i];
            var dic = str.ToIndiciesDictionary();
            HashSet<int> toDelete = new HashSet<int>();
            foreach (var ind in dic[el])
            {
                if (ind > 0 && str[ind] - str[ind - 1] == 1)
                {
                    toDelete.Add(ind);
                }
                else if (ind < str.Length - 1 && str[ind] - str[ind + 1] == 1)
                {
                    toDelete.Add(ind);

                }

            }
            if (toDelete.Count > 0)
            {
                if (dic[el].Count > toDelete.Count)
                    i --;
                cnt += toDelete.Count;
                str = string.Join("", str.Where((el2, index) => !toDelete.Contains(index)));
            }
        }
        cnt.WriteLine();
    }

}

using System;
using System.Collections.Generic;
using System.Linq;
using CompLib.Util;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        string s = sc.Next();

        // n文字 sがある

        // s_iに隣接する文字がs_iより1つ小さいならs_iを消せる

        // 消せる 最大

        var ar = s.ToCharArray();

        for (char c = 'z'; c >= 'b'; c--)
        {
            var stack = new Stack<char>();
            foreach (char ch in ar)
            {
                if (ch == c && stack.Count > 0 && stack.Peek() == c - 1)
                {
                    continue;
                }
                else if (ch == c - 1)
                {
                    while (stack.Count > 0 && stack.Peek() == c)
                    {
                        stack.Pop();
                    }
                    stack.Push(ch);
                }
                else
                {
                    stack.Push(ch);
                }
            }

            ar = new char[stack.Count];
            for (int i = ar.Length - 1; i >= 0; i--)
            {
                ar[i] = stack.Pop();
            }
        }

        Console.WriteLine(n - ar.Length);
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

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

class Test
{
    class a
    {
        public char key;
        public int value;
    }
    // Driver code
    public static void Main()
    {

        //// var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        //var t = input[0];
        //while (t > 0)
        {

            var input1 = Console.ReadLine().Split(' ').Select(xx => int.Parse(xx)).ToArray();
            var n = input1[0];
            // var k = input1[1];

            var x = Console.ReadLine().ToCharArray();
			if (x.Length <= 1)
			{
				Console.WriteLine(0);
				return;
			}
			int s = 0;
			for (int i = 25; i > 0; i--)
			{
				char y = (char)(i + 'a'), z = (char)(i - 1 + 'a');
				for (int j = 0; j < n; j++)
				{
					if (x[j] == y)
					{
						int l = j - 1, r = j + 1;
						while (l>=0&&(x[l] == '?' || x[l] == y))
						{
							l--;
						}
						if (l >= 0)
						{
							if (x[l] == z)
							{
								s++;
								x[j] = '?';
								continue;
							}
						}
						while ((r<n)&&(x[r] == '?' || x[r] == y))
						{
							r++;
						}
						if (r < n)
						{
							if (x[r] == z)
							{
								s++;
								x[j] = '?';
							}
						}
					}
				}
			}

			Console.WriteLine(s);

            }

        }
    }

using System.Collections.Generic;
using System;

class _1321C
{
	static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		string s = Console.ReadLine();
		List<char> list = new List<char>(s.ToCharArray());
		int cnt = 0;
		const int LetterLen = 26;
		for (int i = LetterLen - 1; i >= 1; --i)
		{
			char cur = (char)('a' + i);
			char prev = (char)(cur - 1);
			for (int j = 0; j < list.Count; ++j)
			{
				if (j >= 1)
				{
					if (list[j] == cur && list[j - 1] == prev)
					{
						list.RemoveAt(j);
						j = 0;
						++cnt;
						continue;
					}
					if (list[j] == prev && list[j - 1] == cur)
					{
						list.RemoveAt(j - 1);
						j = 0;
						++cnt;
						continue;
					}
				}
			}
		}
		Console.WriteLine(cnt);
	}
}

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

class Program
{
    static void test123()
    {

        string str = Console.ReadLine();
        var str1 = str.Split(' ');

        UInt64 n = Convert.ToUInt64(str1[0]);
        UInt64 m = Convert.ToUInt64(str1[1]);
        UInt64 a = Convert.ToUInt64(str1[2]);

        UInt64 a1 = n / a + (UInt64) (n % a > 0 ? 1 : 0);
        UInt64 a2 = m / a + (UInt64) (m % a > 0 ? 1 : 0);

        Console.WriteLine(a1 * a2);

    }

    static (char, List<int>) MaxSymbolLowerThan(string str, int maxValue)
    {
        int maxFindedValue = 0;
        int indexOfMax = 0;
        List<int> indexes = new List<int>();

        for (int i = 0; i < str.Length; i++)
        {
            if (str[i] > maxFindedValue && (int) str[i] < maxValue) // проверить как он кастуется к инту
            {
                indexes.Clear();
                indexes.Add(i);
                maxFindedValue = (int) (str[i]); //Char.GetNumericValue
            }
            else if (maxFindedValue == str[i])
            {
                indexes.Add(i);
            }
        }

        return ((char)maxFindedValue, indexes);
    }

    static void test3234234()
    {
        int n = Convert.ToInt32(Console.ReadLine());

        int steps = 0;

        string str = Console.ReadLine();

        //int count = 0;

        int indexOfMax = 0; // нужен ли ?

        List<int> indexesOfMax;

        char maxSymbol = ' ';
        (maxSymbol, indexesOfMax) = MaxSymbolLowerThan(str, 9999);

        //var indexesOfMaxBuffer = indexesOfMax.GetRange(0, n);
        //int[] indexEsOfMaxValue = str.Where(s=>s==maxSymbol).Select()

        int minValue = str.Min();

        bool ValueWasFinded = false;
        bool LastSymbol = false;
        int countOfIndexes = 123;
        //while (true)
        //{
        //if (n == 1) // лучше через n
        //{
        //    Console.WriteLine(steps);
        //    return;
        //}

        //if (LastSymbol && minValue == (int) maxSymbol) // еще один флаг ?  проверка недоделана !!!
        //{
        //    Console.WriteLine(steps);
        //    return;
        //}

        int j = 0; // индекс в IndexesOfMax
        while (true)
        {
            if (countOfIndexes == 0)
            {
                Console.WriteLine(steps);
                return;
            }

            if (j < indexesOfMax.Count && indexesOfMax[j] != 0 && str[indexesOfMax[j] - 1] == (int) str[indexesOfMax[j]] - 1 )
            {
                ValueWasFinded = true;
                str = str.Remove(indexesOfMax[j], 1);
                steps++;
                n--;
                indexesOfMax.RemoveAt(j);
                for (var z = j ; z < indexesOfMax.Count; z++)
                    indexesOfMax[z]--;

            }

            else if (j < indexesOfMax.Count && indexesOfMax[j] != n - 1 && str[indexesOfMax[j] + 1] == (int) (str[indexesOfMax[j]]) - 1)
            {
                ValueWasFinded = true;
                str = str.Remove(indexesOfMax[j], 1);

                steps++;
                n--;
                indexesOfMax.RemoveAt(j);
                for (var z = j ; z<indexesOfMax.Count; z++)
                    indexesOfMax[z]--;

            }

            else
            {
                if (j >= indexesOfMax.Count - 1)
                {
                    if (!ValueWasFinded)
                    {
                        (maxSymbol, indexesOfMax) = MaxSymbolLowerThan(str, (int) maxSymbol);
                        countOfIndexes = indexesOfMax.Count;
                    }
                    else
                        ValueWasFinded = false;
                    j = 0;
                }
                else
                    j++;
            }
        }
    }

    static void Main(string[] args)
    {

        test3234234();
    }
}

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

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            TextReader sr = Console.In;
            //StreamReader sr = new StreamReader("3.txt");
            int n = Convert.ToInt32(sr.ReadLine());
            string ss = sr.ReadLine();
            List<char> str = new List<char>();
            for (int ii = 0; ii < n; ii++)
            {
                str.Add(ss[ii]);
            }
            int i = 0;
            int res = 0;
            char b = 'z';
            while (true)
            {
                if (i == str.Count())
                {
                    i = 0;
                    b--;
                    if (b < 'a') break;
                    else continue;
                }
                if (str[i] == b)
                {
                    if ((i > 0) && (str[i - 1] == (b - 1)))
                    {
                        str.RemoveAt(i);
                        res++;
                    }
                    else if ((i < str.Count - 1) && (str[i + 1] == (b - 1)))
                    {
                        str.RemoveAt(i);
                        res++;
                        if (i > 0) i--;
                    }
                    else
                    {
                        i++;
                    }
                }
                else
                {
                    i++;
                }
            }
            Console.WriteLine(res.ToString());
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {

        static void PrintAnswer(int s, List<char> text)
        {
            bool Finished = false; bool errorFound = false;
            int c = 0;
            while (!Finished)
            {
                errorFound = false;
                int biggerIndex = 0;

                // biggerIndex = text.IndexOf(text.OrderByDescending(x => (int)(x)).First());

                for (int i = biggerIndex; i < text.Count; i++)
                {
                    if (i == 0)
                    {
                        if (text[i] == 'a')
                        {
                            continue;
                        }
                        else
                        {
                            if (text.Count > 1)
                            if (((int)text[i]) - ((int)text[i + 1]) == 1)
                            {
                                c++; text.RemoveAt(i); errorFound = true; break;
                            }
                        }
                    }
                    else if (i == text.Count - 1)
                    {
                        if (text[i] == 'a')
                        {
                            continue;
                        }
                        else
                        {
                            if (text.Count > 1)
                                if (((int)text[i]) - ((int)text[i - 1]) == 1)
                            {
                                c++; text.RemoveAt(i); errorFound = true; break;
                            }
                        }
                    }
                    else
                    {
                        if (text[i] == 'a')
                        {
                            continue;
                        }
                        else
                        {
                            if (text.Count > 1 && i > 0)
                                if (((int)text[i]) - ((int)text[i + 1]) == 1)
                                {
                                    c++; text.RemoveAt(i); errorFound = true; break;
                                }
                            if (text.Count > 2 && i < text.Count-2)
                                if (((int)text[i]) - ((int)text[i + 1]) == 1)
                                {
                                    c++; text.RemoveAt(i); errorFound = true; break;
                                }
                        }
                    }
                }
                if (!errorFound)
                    Finished = true;
            }
            Console.WriteLine(c);
        }
        static void Main(string[] args)
        {
            int s = Int32.Parse(Console.ReadLine());
            List<char> text = Console.ReadLine().Select(x => x).ToList();

            // PrintAnswer(s,text);
            FindMaxChars(s, text);
        }

        static void FindMaxChars(int s, List<char> text)
        {
            if (s == 1) { Console.WriteLine(0); return; }
            int c = 0;

            bool Finished = false;

            while (!Finished)
            {
            ResetLoop:
                if (text.Count == 1) goto EndLoop;
                List<char> bigChars = text.Distinct().OrderByDescending(x => (int)x).ToList();
                for (int j = 0; j < bigChars.Count; j++)
                {
                    if (bigChars[j] == 'a') continue;
                    for (int i = 0; i < text.Count; i++)
                    {
                        if (text[i] == bigChars[j])
                        {
                            // check for previous
                            if (i > 0)
                            {
                                if ((int)text[i] - (int)text[i - 1] == 1)
                                {
                                    text.RemoveAt(i); c++;  goto ResetLoop;
                                }
                            }
                            // check for next
                            if (i < text.Count-1)
                            {
                                if ((int)text[i] - (int)text[i + 1] == 1)
                                {
                                    text.RemoveAt(i); c++; goto ResetLoop;
                                }
                            }
                        }
                    }
                }

                EndLoop:
                Finished = true;
            }

            Console.WriteLine(c);
        }
    }
}

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

namespace ConsoleApplication1
{
    class Program
    {

        static void PrintAnswer(int s, List<char> text)
        {
            bool Finished = false; bool errorFound = false;
            int c = 0;
            while (!Finished)
            {
                errorFound = false;
                int biggerIndex = 0;

                // biggerIndex = text.IndexOf(text.OrderByDescending(x => (int)(x)).First());

                for (int i = biggerIndex; i < text.Count; i++)
                {
                    if (i == 0)
                    {
                        if (text[i] == 'a')
                        {
                            continue;
                        }
                        else
                        {
                            if (text.Count > 1)
                            if (((int)text[i]) - ((int)text[i + 1]) == 1)
                            {
                                c++; text.RemoveAt(i); errorFound = true; break;
                            }
                        }
                    }
                    else if (i == text.Count - 1)
                    {
                        if (text[i] == 'a')
                        {
                            continue;
                        }
                        else
                        {
                            if (text.Count > 1)
                                if (((int)text[i]) - ((int)text[i - 1]) == 1)
                            {
                                c++; text.RemoveAt(i); errorFound = true; break;
                            }
                        }
                    }
                    else
                    {
                        if (text[i] == 'a')
                        {
                            continue;
                        }
                        else
                        {
                            if (text.Count > 1 && i > 0)
                                if (((int)text[i]) - ((int)text[i + 1]) == 1)
                                {
                                    c++; text.RemoveAt(i); errorFound = true; break;
                                }
                            if (text.Count > 2 && i < text.Count-2)
                                if (((int)text[i]) - ((int)text[i + 1]) == 1)
                                {
                                    c++; text.RemoveAt(i); errorFound = true; break;
                                }
                        }
                    }
                }
                if (!errorFound)
                    Finished = true;
            }
            Console.WriteLine(c);
        }
        static void Main(string[] args)
        {
            int s = Int32.Parse(Console.ReadLine());
            List<char> text = Console.ReadLine().Select(x => x).ToList();

            // PrintAnswer(s,text);
            FindMaxChars(s, text);
        }

        static void FindMaxChars(int s, List<char> text)
        {
            if (s == 1) { Console.WriteLine(0); return; }
            bool Finished = false; bool errorFound = false;
            int c = 0;
            while (!Finished)
            {
                errorFound = false;
                List<char> bigChars = text.OrderByDescending(x => (int)x).Distinct().Where(x => x != 'a').ToList();

                while (bigChars.Count > 0)
                {
                    int bigCharIndex = text.IndexOf(bigChars.First());
                    for (int i = 0; i < text.Count; i++)
                    {
                        if (text[i] == bigChars.First())
                        {
                            if (text.Count == 1) { Finished = true; bigChars = new List<char>(); break; }
                            if (i == 0)
                            {
                                if (((int)text[i]) - ((int)text[i + 1]) == 1)
                                {
                                    c++; text.RemoveAt(i); errorFound = true; break;
                                }
                            }
                            else if (i == text.Count - 1)
                            {
                                if (((int)text[i]) - ((int)text[i - 1]) == 1)
                                {
                                    c++; text.RemoveAt(i); errorFound = true; break;
                                }
                            }
                            else
                            {
                                if (((int)text[i]) - ((int)text[i + 1]) == 1 || ((int)text[i]) - ((int)text[i - 1]) == 1)
                                {
                                    c++; text.RemoveAt(i); errorFound = true; break;
                                }
                            }
                        }
                    }
                    if (bigChars.Count > 0)
                    bigChars.RemoveAt(0);
                }

                if (!errorFound) Finished = true;
            }
            Console.WriteLine(c);
        }
    }
}

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

class Test
{
    class a
    {
        public char key;
        public int value;
    }
    // Driver code
    public static void Main()
    {

        //// var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        //var t = input[0];
        //while (t > 0)
        {

            var input1 = Console.ReadLine().Split(' ').Select(xx => int.Parse(xx)).ToArray();
            var n = input1[0];
            // var k = input1[1];

            var x = Console.ReadLine().ToCharArray();
			if (x.Length <= 1)
				return ;
			int s = 0;
			for (int i = 25; i > 0; i--)
			{
				char y = (char)(i + 'a'), z = (char)(i - 1 + 'a');
				for (int j = 0; j < n; j++)
				{
					if (x[j] == y)
					{
						int l = j - 1, r = j + 1;
						while (l>=0&&(x[l] == '?' || x[l] == y))
						{
							l--;
						}
						if (l >= 0)
						{
							if (x[l] == z)
							{
								s++;
								x[j] = '?';
								continue;
							}
						}
						while (x[r] == '?' || x[r] == y)
						{
							r++;
						}
						if (r < n)
						{
							if (x[r] == z)
							{
								s++;
								x[j] = '?';
							}
						}
					}
				}
			}

			Console.WriteLine(s);

            }

        }
    }

using System.Collections.Generic;
using System;

class _1321C
{
	static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		string s = Console.ReadLine();
		List<char> list = new List<char>(s.ToCharArray());
		int cnt = 0;
		const int LetterLen = 26;
		for (int i = LetterLen - 1; i >= 1; --i)
		{
			char cur = (char)('a' + i);
			char prev = (char)(cur - 1);
			for (int j = 0; j < list.Count; ++j)
			{
				if (j >= 1)
				{
					if (list[j] == cur && list[j - 1] == prev)
					{
						list.RemoveAt(j);
						j = 0;
						++cnt;
						continue;
					}
				}
				if (j <= list.Count - 2)
				{
					if (list[j] == cur && list[j + 1] == prev)
					{
						list.RemoveAt(j);
						j = 0;
						++cnt;
						continue;
					}
				}
			}
		}
		Console.WriteLine(cnt);
	}
}


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

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            bool IT;
            int TUX = 0;
            int FOO = 0;
            int BAR = 0;
            int BAZ = 0;
            int QUZ = 1;

            try
            {
                TUX = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                TUX = 0;
            }

            for (; TUX != 0; TUX--)
            {
                try
                {
                    int PUR = int.Parse(Console.ReadLine());
                    FOO += PUR;
                    BAR++;
                    IT = Math.Max((FOO*QUZ), (BAR*BAZ)) == (FOO*QUZ);
                    if (IT)
                    {
                        BAZ = FOO;//obshaya summa balov igroka
                        QUZ = BAR;//popitka
                    }
                }
                catch (Exception)
                {
                    TUX = 0;
                }
            }

            Console.WriteLine((double)BAZ/(double)QUZ);
        }
    }
}

using System;
using System.IO;
using System.Linq;

namespace CodeForces
{
	internal class Template
	{
		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
			//Console.SetIn(new StreamReader(@"C:\CodeForces\input.txt"));
			Solve();
		}

		private static void Solve()
		{
			var TUX = cin.NextInt();
			var foo = 0;
			var bar = 0;
			var baz = 0;
			var quz = 1;
			while (TUX-- != 0)
			{
				var PUR = cin.NextInt();
				foo = foo + PUR;
				bar = bar + 1;
				if (foo * quz > bar * baz)
				{
					baz = foo;
					quz = bar;
				}
			}
			Console.WriteLine(1.0 * baz / quz);
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = new[] { ' ' };

		public string Next()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

		public double NextDouble()
		{
			return double.Parse(Next());
		}

		public int NextInt()
		{
			return int.Parse(Next());
		}

		public long NextLong()
		{
			return long.Parse(Next());
		}
	}
}

using System;

namespace Csh
{
    class Program
    {
        static void Main(string[] args)
        {
            int tux = int.Parse(Console.ReadLine());
            int foo = 0, bar = 0, baz = 0, quz = 1;
            while (tux != 0)
            {
                int pur = int.Parse(Console.ReadLine());
                foo += pur;
                bar++;
                if (Math.Max(foo * quz, bar * baz) == foo * quz)
                //BOTH SAEM BIGGR OF PRODUKT OF FOO AN QUZ AN PRODUKT OF BAR BAZ AN PRODUKT OF FOO AN QUZ
                {
                    baz = foo;
                    quz = bar;
                }
                tux--;
            }
            Console.WriteLine((double) baz / (double)quz);
        }
    }
}

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

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            bool IT;
            int TUX = 0;
            int FOO = 0;
            int BAR = 0;
            int BAZ = 0;
            int QUZ = 1;

            try
            {
                TUX = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                TUX = 0;
            }

            for (; TUX != 0; TUX--)
            {
                try
                {
                    int PUR = int.Parse(Console.ReadLine());
                    FOO += PUR;
                    BAR++;
                    //IT = Math.Max((FOO*QUZ), (BAR*BAZ)) == (FOO*QUZ);
                    if ((FOO * QUZ) > (BAR * BAZ))
                    {
                        BAZ = FOO;//obshaya summa balov igroka
                        QUZ = BAR;//popitka
                    }
                }
                catch (Exception)
                {
                    TUX = 0;
                }
            }

            Console.WriteLine((double)BAZ/(double)QUZ);
        }
    }
}

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

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

            var Foo = 0;
            var Bar = 0;
            var Baz = 0;
            var Quz = 1;

            for (; Tux > 0; Tux--)
            {
                int Pur;
                Pur = int.Parse(Console.ReadLine());

                Foo = Foo + Pur;
                Bar = Bar + 1;

                if (Math.Max(Foo * Quz, Bar * Baz) == Foo * Quz)
                {
                    Baz = Foo;
                    Quz = Bar;
                }
            }

            Console.WriteLine((double)Baz / (double)Quz);
        }
    }
}

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

namespace CodeForces
{
    class R176_AprilFool_C
    {
        static void Main(string[] args)
        {
            int tux = int.Parse(Console.ReadLine());
            int foo = 0, bar = 0, baz = 0, quz = 1;
            while (tux != 0)
            {
                int pur = int.Parse(Console.ReadLine());
                foo += pur;
                bar++;
                if (foo * quz > bar * baz)
                {
                    baz = foo;
                    quz = bar;
                }
                tux--;
            }
            Console.WriteLine((double) baz / (double)quz);
        }
    }
}

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

namespace AprilFools
{
    internal class Program
    {
        private const string TestIn = @"..\..\In\Text.in";
        private const string TestOut = @"..\..\In\Text.out";

        private static void Solve()
        {
            double res = 0;

            int tux;
            tux = ReadInt();
            int foo = 0;
            int bar = 0;
            int baz = 0;
            int quz = 1;

            for(;tux > 0;tux--)
            {
                int pur = ReadInt();
                foo = foo + pur;
                bar= bar + 1;
                if (Math.Max(foo * quz, bar * baz) == (foo * quz))
                {
                    baz = foo;
                    quz = bar;
                }

            }

            Console.WriteLine((double)baz/(double)quz);
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
                Console.SetIn(new StreamReader(TestIn));
                Console.SetOut(new StreamWriter(TestOut));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.Out.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                //Console.ReadLine();
            }
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static List<int> ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();
            return input;
        }

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

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}

#define Online

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Threading;

delegate double F(double x);
delegate decimal Fdec(decimal x);

class Program
{//

    static void Main(string[] args)
    {

        Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

#if FileIO
        StreamReader sr = new StreamReader("forest.in");
        StreamWriter sw = new StreamWriter("forest.out");
        Console.SetIn(sr);
        Console.SetOut(sw);
#endif
        int tux = ReadInt();
        int foo = 0;
        int bar = 0;
        int baz = 0;
        int quz = 0;

        for (; tux > 0; tux--)
        {
            int pur;
            pur = ReadInt();
            foo = foo + pur;
            bar = bar + 1;
            if (Math.Max(foo * quz, bar * baz) == (foo * quz))
            {
                baz = foo;
                quz = bar;
            }
        }
        double ans = (double)baz / (double)quz;
        Console.WriteLine(ans);
#if Online
        Console.ReadLine();
#endif

#if FileIO
        sr.Close();
        sw.Close();
#endif
    }

    static string[] ReadArray()
    {
        return Console.ReadLine().Split(' ');
    }

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

static class ArrayUtils
{
    public static int BinarySearch(int[] a, int val)
    {
        int left = 0;
        int right = a.Length - 1;
        int mid;

        while (left < right)
        {
            mid = left + ((right - left) >> 1);
            if (val <= a[mid])
            {
                right = mid;
            }
            else
            {
                left = mid + 1;
            }
        }

        if (a[left] == val)
            return left;
        else
            return -1;
    }

    public static double Bisection(F f, double left, double right, double eps)
    {
        double mid;
        while (right - left > eps)
        {
            mid = left + ((right - left) / 2d);
            if (Math.Sign(f(mid)) != Math.Sign(f(left)))
                right = mid;
            else
                left = mid;
        }
        return (left + right) / 2d;
    }

    public static decimal TernarySearchDec(Fdec f, decimal eps, decimal l, decimal r, bool isMax)
    {
        decimal m1, m2;
        while (r - l > eps)
        {
            m1 = l + (r - l) / 3m;
            m2 = r - (r - l) / 3m;
            if (f(m1) < f(m2))
                if (isMax)
                    l = m1;
                else
                    r = m2;
            else
                if (isMax)
                    r = m2;
                else
                    l = m1;
        }
        return r;
    }

    public static double TernarySearch(F f, double eps, double l, double r, bool isMax)
    {
        double m1, m2;
        while (r - l > eps)
        {
            m1 = l + (r - l) / 3d;
            m2 = r - (r - l) / 3d;
            if (f(m1) < f(m2))
                if (isMax)
                    l = m1;
                else
                    r = m2;
            else
                if (isMax)
                    r = m2;
                else
                    l = m1;
        }
        return r;
    }

    public static void Merge(int[] A, int p, int q, int r, int[] L, int[] R)
    {
        for (int i = p; i <= q; i++)
            L[i] = A[i];
        for (int i = q + 1; i <= r; i++)
            R[i] = A[i];

        for (int k = p, i = p, j = q + 1; k <= r; k++)
        {
            if (i > q)
            {
                for (; k <= r; k++, j++)
                    A[k] = R[j];
                return;
            }
            if (j > r)
            {
                for (; k <= r; k++, i++)
                    A[k] = L[i];
                return;
            }
            if (L[i] <= R[j])
            {
                A[k] = L[i];
                i++;
            }
            else
            {
                A[k] = R[j];
                j++;
            }
        }
    }

    public static void Merge_Sort(int[] A, int p, int r, int[] L, int[] R)
    {
        if (!(p < r)) return;
        int q = p + ((r - p) >> 1);
        Merge_Sort(A, p, q, L, R);
        Merge_Sort(A, q + 1, r, L, R);
        Merge(A, p, q, r, L, R);
    }
}

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

namespace CodeForces
{
    class Prob290C
    {
        //HAI
        //I HAS A TUX
        //GIMMEH TUX
        //I HAS A FOO ITS 0
        //I HAS A BAR ITS 0
        //I HAS A BAZ ITS 0
        //I HAS A QUZ ITS 1
        //TUX IS NOW A NUMBR
        //IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
        //I HAS A PUR
        //GIMMEH PUR
        //PUR IS NOW A NUMBR
        //FOO R SUM OF FOO AN PUR
        //BAR R SUM OF BAR AN 1
        //BOTH SAEM BIGGR OF PRODUKT OF FOO AN QUZ AN PRODUKT OF BAR BAZ AN PRODUKT OF FOO AN QUZ
        //O RLY?
        //YA RLY
        //BAZ R FOO
        //QUZ R BAR
        //OIC
        //IM OUTTA YR LOOP
        //BAZ IS NOW A NUMBAR
        //VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
        //KTHXBYE

        int totalNums; //total number of input numbers
        int[] numbers; //an array of numbers of length totalNums

        public Prob290C(int tot, int[] nums)
        {
            totalNums = tot;
            numbers = new int[totalNums];
            Array.Copy(nums, 0, numbers, 0, totalNums);
        }

        public double solve()
        {
            //HAI
            //I HAS A TUX
            //GIMMEH TUX

            //I HAS A FOO ITS 0
            //I HAS A BAR ITS 0
            //I HAS A BAZ ITS 0
            //I HAS A QUZ ITS 1
            long foo = 0, bar = 0, baz = 0, quz = 1;

            //TUX IS NOW A NUMBR

            //IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
            for (int i = 0; i < totalNums; ++i)
            {
                //I HAS A PUR
                //GIMMEH PUR
                //PUR IS NOW A NUMBR

                //FOO R SUM OF FOO AN PUR
                foo += numbers[i];
                //BAR R SUM OF BAR AN 1
                ++bar;

                //BOTH SAEM BIGGR OF PRODUKT OF FOO AN QUZ AN PRODUKT OF BAR BAZ AN PRODUKT OF FOO AN QUZ
                if (Math.Max(foo * quz, bar * baz) == foo * quz)
                {
                    //O RLY?
                    //YA RLY

                    //BAZ R FOO
                    baz = foo;
                    //QUZ R BAR
                    quz = bar;
                }
                //OIC
                //IM OUTTA YR LOOP
            }
            //BAZ IS NOW A NUMBAR
            //VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
            //KTHXBYE
            return (double)baz / quz;
        }

        public override String ToString()
        {
            return "";
        }

        static void Main(string[] args)
        {
            int totalNums = Convert.ToInt32(Console.ReadLine());
            int[] numbers = new int[totalNums];
            for (int i = 0; i < totalNums; ++i)
            {
                numbers[i] = Convert.ToInt32(Console.ReadLine());
            }
            Prob290C prob = new Prob290C(totalNums, numbers);
            Console.WriteLine(prob.solve());
        }
    }
}

using System;
using System.Globalization;

public class Class4
{
    public static void Main()
    {
        Solve(new ConsoleInput());
    }

    private static void Solve(IInput input)
    {
        // HAI
        // I HAS A TUX
        // GIMMEH TUX
        // I HAS A FOO ITS 0
        // I HAS A BAR ITS 0
        // I HAS A BAZ ITS 0
        // I HAS A QUZ ITS 1
        // TUX IS NOW A NUMBR
        var tux = int.Parse(input.ReadLine());
        var foo = 0;
        var bar = 0;
        var baz = 0;
        var quz = 0;

        // IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
        for (; tux > 0; tux--)
        {
            // I HAS A PUR
            // GIMMEH PUR
            // PUR IS NOW A NUMBR
            var pur = int.Parse(input.ReadLine());

            // FOO R SUM OF FOO AN PUR
            foo += pur;

            // BAR R SUM OF BAR AN 1
            bar += 1;

            // BOTH SAEM ( BIGGR OF ( (PRODUKT OF FOO AN QUZ) AN (PRODUKT OF BAR BAZ)) AN PRODUKT OF FOO AN QUZ) )
            // O RLY?
            if (Math.Max(foo * quz, bar * baz) == (foo * quz))
            {
                // YA RLY
                // BAZ R FOO
                // QUZ R BAR
                baz = foo;
                quz = bar;

                // OIC
            }

            // IM OUTTA YR LOOP
        }

        // BAZ IS NOW A NUMBAR
        // VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
        Console.WriteLine(((float)baz / quz).ToString("F6", CultureInfo.InvariantCulture));

        // KTHXBYE
    }
}

#region input
public interface IInput
{
    string ReadLine();
}

public class ConsoleInput : IInput
{
    public string ReadLine()
    {
        return Console.ReadLine();
    }
}

public abstract class AbstractMockInput : IInput
{
    protected virtual string[] lines { get; }

    private int currentLine = 0;

    public string ReadLine()
    {
        if (this.currentLine >= this.lines.Length)
        {
            return string.Empty;
        }

        var res = this.lines[this.currentLine];
        this.currentLine++;
        return res;
    }
}

public class MockInput1 : AbstractMockInput
{
    protected override string[] lines => new[] { "3", "0", "1", "1" };
}

#endregion

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

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

    static Queue<string> currentLineTokens = new Queue<string>();

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

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

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

    public static int[] ReadIntArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        int TUX = ReadInt();
        int FOO=0;
        int BAR=0;
        int BAZ=0;
        int QUZ=1;
        for (int i = 0; i < TUX; i++)
        {
            int PUR = ReadInt();
            FOO = (FOO + PUR);
            BAR = (BAR + 1);
            if (FOO * QUZ >= BAR * BAZ)
            {
                BAZ = FOO;
                QUZ = BAR;
            }
        }
        return (1.0 * BAZ / QUZ).ToString(CultureInfo.InvariantCulture);

    }
}

using System;
using System.IO;
using System.Linq;

namespace CodeForces
{
	internal class Template
	{
		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
			//Console.SetIn(new StreamReader(@"C:\CodeForces\input.txt"));
			Solve();
		}

		private static void Solve()
		{
			var TUX = cin.NextInt();
			var foo = 0;
			var bar = 0;
			var baz = 0;
			var quz = 1;
			while (TUX-- != 0)
			{
				var PUR = cin.NextInt();
				foo = foo + PUR;
				bar = bar + 1;
				var prod1 = foo*quz;
				var prod2 = bar*baz;
				var prod3 = foo*quz;
				//if (foo > prod1 && foo > prod2 && bar > prod1 && bar > prod2)
				{
					baz = foo;
					quz = bar;
				}
			}
			Console.WriteLine(1.0 * baz / quz);
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = new[] { ' ' };

		public string Next()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

		public double NextDouble()
		{
			return double.Parse(Next());
		}

		public int NextInt()
		{
			return int.Parse(Next());
		}

		public long NextLong()
		{
			return long.Parse(Next());
		}
	}
}

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

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

            var Foo = 0;
            var Bar = 0;
            var Baz = 0;
            var Quz = 1;

            for(;Tux > 0; Tux--)
            {
                int Pur;
                Pur = int.Parse(Console.ReadLine());

                Foo = Foo + Pur;
                Bar = Bar + 1;

                if (Math.Max(Foo * Quz, Bar) >= Math.Max(Baz, Foo * Quz))
                {
                    Baz = Foo;
                    Quz = Bar;
                }
            }

            Console.WriteLine((double)Baz / (double)Quz);
        }
    }
}

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

namespace CodeForces
{
    class Prob290C
    {
        //HAI
        //I HAS A TUX
        //GIMMEH TUX
        //I HAS A FOO ITS 0
        //I HAS A BAR ITS 0
        //I HAS A BAZ ITS 0
        //I HAS A QUZ ITS 1
        //TUX IS NOW A NUMBR
        //IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
        //I HAS A PUR
        //GIMMEH PUR
        //PUR IS NOW A NUMBR
        //FOO R SUM OF FOO AN PUR
        //BAR R SUM OF BAR AN 1
        //BOTH SAEM BIGGR OF PRODUKT OF FOO AN QUZ AN PRODUKT OF BAR BAZ AN PRODUKT OF FOO AN QUZ
        //O RLY?
        //YA RLY
        //BAZ R FOO
        //QUZ R BAR
        //OIC
        //IM OUTTA YR LOOP
        //BAZ IS NOW A NUMBAR
        //VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
        //KTHXBYE

        int totalNums; //total number of input numbers
        int[] numbers; //an array of numbers of length totalNums

        public Prob290C(int tot, int[] nums)
        {
            totalNums = tot;
            numbers = new int[totalNums];
            Array.Copy(nums, 0, numbers, 0, totalNums);
        }

        public double solve()
        {
            //HAI
            //I HAS A TUX
            //GIMMEH TUX

            //I HAS A FOO ITS 0
            //I HAS A BAR ITS 0
            //I HAS A BAZ ITS 0
            //I HAS A QUZ ITS 1
            int foo = 0, bar = 0, baz = 0, quz = 1;

            //TUX IS NOW A NUMBR

            //IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
            for (int i = 0; i < totalNums; ++i)
            {
                //I HAS A PUR
                //GIMMEH PUR
                //PUR IS NOW A NUMBR

                //FOO R SUM OF FOO AN PUR
                foo += numbers[i];
                //BAR R SUM OF BAR AN 1
                ++bar;

                //BOTH SAEM BIGGR OF PRODUKT OF FOO AN QUZ AN PRODUKT OF BAR BAZ AN PRODUKT OF FOO AN QUZ
                if (foo * quz * bar > baz * foo * quz)
                {
                    //O RLY?
                    //YA RLY

                    //BAZ R FOO
                    baz = foo;
                    //QUZ R BAR
                    quz = bar;
                }
                //OIC
                //IM OUTTA YR LOOP
            }
            //BAZ IS NOW A NUMBAR
            //VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
            //KTHXBYE
            return (double)baz / quz;
        }

        public override String ToString()
        {
            return "";
        }

        static void Main(string[] args)
        {
            int totalNums = Convert.ToInt32(Console.ReadLine());
            int[] numbers = new int[totalNums];
            for (int i = 0; i < totalNums; ++i)
            {
                numbers[i] = Convert.ToInt32(Console.ReadLine());
            }
            Prob290C prob = new Prob290C(totalNums, numbers);
            Console.WriteLine(prob.solve());
        }
    }
}

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

namespace CodeForces
{
    class Prob290C
    {
        //HAI
        //I HAS A TUX
        //GIMMEH TUX
        //I HAS A FOO ITS 0
        //I HAS A BAR ITS 0
        //I HAS A BAZ ITS 0
        //I HAS A QUZ ITS 1
        //TUX IS NOW A NUMBR
        //IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
        //I HAS A PUR
        //GIMMEH PUR
        //PUR IS NOW A NUMBR
        //FOO R SUM OF FOO AN PUR
        //BAR R SUM OF BAR AN 1
        //BOTH SAEM BIGGR OF PRODUKT OF FOO AN QUZ AN PRODUKT OF BAR BAZ AN PRODUKT OF FOO AN QUZ
        //O RLY?
        //YA RLY
        //BAZ R FOO
        //QUZ R BAR
        //OIC
        //IM OUTTA YR LOOP
        //BAZ IS NOW A NUMBAR
        //VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
        //KTHXBYE

        int totalNums; //total number of input numbers
        int[] numbers; //an array of numbers of length totalNums

        public Prob290C(int tot, int[] nums)
        {
            totalNums = tot;
            numbers = new int[totalNums];
            Array.Copy(nums, 0, numbers, 0, totalNums);
        }

        public double solve()
        {
            //HAI
            //I HAS A TUX
            //GIMMEH TUX

            //I HAS A FOO ITS 0
            //I HAS A BAR ITS 0
            //I HAS A BAZ ITS 0
            //I HAS A QUZ ITS 1
            long foo = 0, bar = 0, baz = 0, quz = 1;

            //TUX IS NOW A NUMBR

            //IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
            for (int i = 0; i < totalNums; ++i)
            {
                //I HAS A PUR
                //GIMMEH PUR
                //PUR IS NOW A NUMBR

                //FOO R SUM OF FOO AN PUR
                foo += numbers[i];
                //BAR R SUM OF BAR AN 1
                ++bar;

                //BOTH SAEM BIGGR OF PRODUKT OF FOO AN QUZ AN PRODUKT OF BAR BAZ AN PRODUKT OF FOO AN QUZ
                if (foo * quz * bar >= baz * foo * quz)
                {
                    //O RLY?
                    //YA RLY

                    //BAZ R FOO
                    baz = foo;
                    //QUZ R BAR
                    quz = bar;
                }
                //OIC
                //IM OUTTA YR LOOP
            }
            //BAZ IS NOW A NUMBAR
            //VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
            //KTHXBYE
            return (double)baz / quz;
        }

        public override String ToString()
        {
            return "";
        }

        static void Main(string[] args)
        {
            int totalNums = Convert.ToInt32(Console.ReadLine());
            int[] numbers = new int[totalNums];
            for (int i = 0; i < totalNums; ++i)
            {
                numbers[i] = Convert.ToInt32(Console.ReadLine());
            }
            Prob290C prob = new Prob290C(totalNums, numbers);
            Console.WriteLine(prob.solve());
        }
    }
}

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

namespace CodeForces
{
    class Prob290C
    {
        //HAI
        //I HAS A TUX
        //GIMMEH TUX
        //I HAS A FOO ITS 0
        //I HAS A BAR ITS 0
        //I HAS A BAZ ITS 0
        //I HAS A QUZ ITS 1
        //TUX IS NOW A NUMBR
        //IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
        //I HAS A PUR
        //GIMMEH PUR
        //PUR IS NOW A NUMBR
        //FOO R SUM OF FOO AN PUR
        //BAR R SUM OF BAR AN 1
        //BOTH SAEM BIGGR OF PRODUKT OF FOO AN QUZ AN PRODUKT OF BAR BAZ AN PRODUKT OF FOO AN QUZ
        //O RLY?
        //YA RLY
        //BAZ R FOO
        //QUZ R BAR
        //OIC
        //IM OUTTA YR LOOP
        //BAZ IS NOW A NUMBAR
        //VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
        //KTHXBYE

        int totalNums; //total number of input numbers
        int[] numbers; //an array of numbers of length totalNums

        public Prob290C(int tot, int[] nums)
        {
            totalNums = tot;
            numbers = new int[totalNums];
            Array.Copy(nums, 0, numbers, 0, totalNums);
        }

        public double solve()
        {
            //HAI
            //I HAS A TUX
            //GIMMEH TUX

            //I HAS A FOO ITS 0
            //I HAS A BAR ITS 0
            //I HAS A BAZ ITS 0
            //I HAS A QUZ ITS 1
            long foo = 0, bar = 0, baz = 0, quz = 1;

            //TUX IS NOW A NUMBR

            //IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
            for (int i = 0; i < totalNums; ++i)
            {
                //I HAS A PUR
                //GIMMEH PUR
                //PUR IS NOW A NUMBR

                //FOO R SUM OF FOO AN PUR
                foo += numbers[i];
                //BAR R SUM OF BAR AN 1
                ++bar;

                //BOTH SAEM BIGGR OF PRODUKT OF FOO AN QUZ AN PRODUKT OF BAR BAZ AN PRODUKT OF FOO AN QUZ
                if (foo * quz * bar > baz * foo * quz)
                {
                    //O RLY?
                    //YA RLY

                    //BAZ R FOO
                    baz = foo;
                    //QUZ R BAR
                    quz = bar;
                }
                //OIC
                //IM OUTTA YR LOOP
            }
            //BAZ IS NOW A NUMBAR
            //VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
            //KTHXBYE
            return (double)baz / quz;
        }

        public override String ToString()
        {
            return "";
        }

        static void Main(string[] args)
        {
            int totalNums = Convert.ToInt32(Console.ReadLine());
            int[] numbers = new int[totalNums];
            for (int i = 0; i < totalNums; ++i)
            {
                numbers[i] = Convert.ToInt32(Console.ReadLine());
            }
            Prob290C prob = new Prob290C(totalNums, numbers);
            Console.WriteLine(prob.solve());
        }
    }
}

using System;

public class Class4
{
    public static void Main()
    {
        Solve(new ConsoleInput());
    }

    private static void Solve(IInput input)
    {
        // HAI
        // I HAS A TUX
        // GIMMEH TUX
        // I HAS A FOO ITS 0
        // I HAS A BAR ITS 0
        // I HAS A BAZ ITS 0
        // I HAS A QUZ ITS 1
        // TUX IS NOW A NUMBR
        var tux = int.Parse(input.ReadLine());
        var foo = 0;
        var bar = 0;
        var baz = 0;
        var quz = 0;

        // IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
        for (; tux > 0; tux--)
        {
            // I HAS A PUR
            // GIMMEH PUR
            // PUR IS NOW A NUMBR
            var pur = int.Parse(input.ReadLine());

            // FOO R SUM OF FOO AN PUR
            foo += pur;

            // BAR R SUM OF BAR AN 1
            bar += 1;

            // BOTH SAEM ( BIGGR OF ( (PRODUKT OF FOO AN QUZ) AN (PRODUKT OF BAR BAZ)) AN PRODUKT OF FOO AN QUZ) )
            // O RLY?
            if (Math.Max(foo * quz, bar * baz) == (foo * quz))
            {
                // YA RLY
                // BAZ R FOO
                // QUZ R BAR
                baz = foo;
                quz = bar;

                // OIC
            }

            // IM OUTTA YR LOOP
        }

        // BAZ IS NOW A NUMBAR
        // VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
        Console.WriteLine((float)baz / quz);

        // KTHXBYE
    }
}

#region input
public interface IInput
{
    string ReadLine();
}

public class ConsoleInput : IInput
{
    public string ReadLine()
    {
        return Console.ReadLine();
    }
}

public abstract class AbstractMockInput : IInput
{
    protected virtual string[] lines { get; }

    private int currentLine = 0;

    public string ReadLine()
    {
        if (this.currentLine >= this.lines.Length)
        {
            return string.Empty;
        }

        var res = this.lines[this.currentLine];
        this.currentLine++;
        return res;
    }
}

public class MockInput1 : AbstractMockInput
{
    protected override string[] lines => new[] { "3", "0", "1", "1" };
}

#endregion

using System;
using System.Globalization;

public class Class4
{
    public static void Main()
    {
        Solve(new MockInput1());
    }

    private static void Solve(IInput input)
    {
        // HAI
        // I HAS A TUX
        // GIMMEH TUX
        // I HAS A FOO ITS 0
        // I HAS A BAR ITS 0
        // I HAS A BAZ ITS 0
        // I HAS A QUZ ITS 1
        // TUX IS NOW A NUMBR
        var tux = int.Parse(input.ReadLine());
        var foo = 0;
        var bar = 0;
        var baz = 0;
        var quz = 0;

        // IM IN YR LOOP NERFIN YR TUX TIL BOTH SAEM TUX AN 0
        for (; tux > 0; tux--)
        {
            // I HAS A PUR
            // GIMMEH PUR
            // PUR IS NOW A NUMBR
            var pur = int.Parse(input.ReadLine());

            // FOO R SUM OF FOO AN PUR
            foo += pur;

            // BAR R SUM OF BAR AN 1
            bar += 1;

            // BOTH SAEM ( BIGGR OF ( (PRODUKT OF FOO AN QUZ) AN (PRODUKT OF BAR BAZ)) AN PRODUKT OF FOO AN QUZ) )
            // O RLY?
            if (Math.Max(foo * quz, bar * baz) == (foo * quz))
            {
                // YA RLY
                // BAZ R FOO
                // QUZ R BAR
                baz = foo;
                quz = bar;

                // OIC
            }

            // IM OUTTA YR LOOP
        }

        // BAZ IS NOW A NUMBAR
        // VISIBLE SMOOSH QUOSHUNT OF BAZ QUZ
        Console.WriteLine(((float)baz / quz).ToString("F6", CultureInfo.InvariantCulture));

        // KTHXBYE
    }
}

#region input
public interface IInput
{
    string ReadLine();
}

public class ConsoleInput : IInput
{
    public string ReadLine()
    {
        return Console.ReadLine();
    }
}

public abstract class AbstractMockInput : IInput
{
    protected virtual string[] lines { get; }

    private int currentLine = 0;

    public string ReadLine()
    {
        if (this.currentLine >= this.lines.Length)
        {
            return string.Empty;
        }

        var res = this.lines[this.currentLine];
        this.currentLine++;
        return res;
    }
}

public class MockInput1 : AbstractMockInput
{
    protected override string[] lines => new[] { "3", "0", "1", "1" };
}

#endregion

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

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

    static Queue<string> currentLineTokens = new Queue<string>();

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

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

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

    public static int[] ReadIntArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        int TUX = ReadInt();
        int FOO=0;
        int BAR=0;
        int BAZ=0;
        int QUZ=1;
        for (int i = 0; i < TUX; i++)
        {
            int PUR = ReadInt();
            FOO = (FOO + PUR);
            BAR = (BAR + 1);
            if (FOO * QUZ >= BAR * BAZ)
            {
                BAZ = FOO;
                QUZ = BAR;
            }
        }
        return 1.0 * BAZ / QUZ;

    }
}

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

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

    static Queue<string> currentLineTokens = new Queue<string>();

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

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

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

    public static int[] ReadIntArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        bool IT;
        int TUX = ReadInt();
        int FOO=0;
        int BAR=0;
        int BAZ=0;
        int QUZ=1;
        for (; TUX != 0; TUX--)
        {
            int PUR = ReadInt();
            FOO = (FOO + PUR);
            BAR = (BAR + 1);
            IT = (Math.Max(FOO * QUZ, BAR * BAZ)) == (FOO * QUZ);
            if(IT)
            {
                BAZ=FOO;
                QUZ=BAR;
            }
        }
        return 1.0 * BAZ / QUZ;

    }
}