public static void Main(String[] args) { int n = int.Parse(Console.ReadLine()); string s = Console.ReadLine(); foreach (char c in s) { if (c == '-') { n -= 2; } } Console.WriteLine(Math.Max(n, 0)); }
public static void Main(String[] args) { int n = int.Parse(Console.ReadLine()); string s = Console.ReadLine(); foreach (char c in s) { if (c == '-') { n -= 2; } } Console.WriteLine(Math.Max(n, 0)); }