import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    readint;
    string s = read!string;

    int ans = 0;
    int x = 0;
    foreach (c; s) {
        switch (c) {
            case 'I': x++; break;
            case 'D': x--; break;
            default: break;
        }
        ans = max(ans, x);
    }
    writeln(ans);
}
