Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            boolean[] isF = new boolean[n];
            for (int i = 0; i < n; i++) {
                isF[i] = in.readCharacter() == 'f';
            }
            FenwickTree[] fenwickTrees = new FenwickTree[n + 1];
            for (int i = 0; i < fenwickTrees.length; i++) {
                fenwickTrees[i] = new FenwickTree(n + 1);
            }
            fenwickTrees[n].add(0, 1);
            for (int idx = n - 1; idx >= 0; idx--) {
                for (int indentLevel = 0; indentLevel < n; indentLevel++) {
                    long fenwickRes;
                    if (isF[idx]) {
                        fenwickRes = fenwickTrees[idx + 1].get(indentLevel + 1, indentLevel + 1);
                    } else {
                        fenwickRes = fenwickTrees[idx + 1].get(0, indentLevel);
                    }
                    fenwickTrees[idx].add(indentLevel, fenwickRes % MiscUtils.MOD7);
                }
            }
            out.printLine(fenwickTrees[0].get(0, 0));
        }
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int... Complexity: