>>405
dotnet add package System.Interactive

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

var q = new List<int>() { ... };
var ans = q.MaxBy(x => x).Count();
System.Console.WriteLine(ans);