# by the authority of GOD     author: manhar singh sachdev #

import os,sys
from io import BytesIO, IOBase

def main():
    n = int(input())
    arr = [input().strip() for _ in range(n)]
    mod,i,arr1 = 10**9+7,0,[]
    while i != n:
        if arr[i] == 'f':
            cnt = 0
            while i != n and arr[i] == 'f':
                cnt += 1
                i += 1
            arr1.append(cnt)
        else:
            arr1.append(0)
        i += 1
    x,y = len(arr1),sum(arr1)
    dp = [[0]*(y+1) for _ in range(x+1)]
    dp[0][0] = 1
    for i in range(1,x+1):
        j = 0
        for k in range(y,arr1[i-1]-1,-1):
            j = (j+dp[i-1][k-arr1[i-1]])%mod
            dp[i][k] = j
    ans = 0
    for i in dp[-1]:
        ans = (ans+i)%mod
    print(ans)

#Fast IO Region
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == '__main__':
    main()


# by the authority of GOD     author: manhar singh sachdev #

import os,sys
from io import BytesIO, IOBase

def main():
    mod = 10**9+7
    n = int(input())
    ans = 1
    dp = [input().strip() for _ in range(n)]
    i,fl = 0,0
    while i != n:
        if fl:
            ans = (ans*2)%mod
            fl = 0
        if dp[i] == 'f':
            while i != n and dp[i] == 'f':
                i += 1
            fl = 1
        i += 1
    print(ans)

#Fast IO Region
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == '__main__':
    main()


n = int(input())
dp = [0] * 5000
MOD = 10 ** 9 + 7
f = 1
dp[0] = 1
for i in range(n):
    a = input()
    if a == "f":
        f += 1
    else:
        for j in range(1, f):
            dp[j] = dp[j] + dp[j - 1]
            dp[j] %= MOD

print(dp[f - 1])


using System;
using System.IO;
using System.Text;

namespace Python_Indentation
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            writer.WriteLine(Solve(args));
            writer.Flush();
        }

        private static long Solve(string[] args)
        {
            int n = Next();

            var nn = new int[n];
            for (int i = 0; i < n; i++)
            {
                nn[i] = Next();
            }

            int mod = 1000000007;

            var dp = new long[n + 1];
            dp[0] = 1;
            for (int i = n - 1; i >= 0; i--)
            {
                if (nn[i] == 0)
                {
                    for (int ii = n; ii > 0; ii--)
                    {
                        dp[ii] = dp[ii - 1];
                    }
                    dp[0] = 0;
                }
                else
                {
                    long sum = 0;
                    for (int ii = n; ii > 0; ii--)
                    {
                        sum += dp[ii];
                        sum %= mod;
                        dp[ii] = sum;
                    }
                }
            }

            long ans = 0;
            for (int i = 0; i < n; i++)
            {
                ans += dp[i];
            }
            return ans%mod;
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == 'f')
                    return 1;
                if (c == 's')
                    return 0;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}


using System;
using System.IO;
using System.Text;

namespace Python_Indentation
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            writer.WriteLine(Solve(args));
            writer.Flush();
        }

        private static long Solve(string[] args)
        {
            int n = Next();

            var nn = new int[n];
            for (int i = 0; i < n; i++)
            {
                nn[i] = Next();
            }

            int mod = 1000000007;

            var dp = new long[n + 1];
            dp[0] = 1;
            for (int i = n - 1; i >= 0; i--)
            {
                if (nn[i] == 0)
                {
                    for (int ii = n; ii > 0; ii--)
                    {
                        dp[ii] = dp[ii - 1];
                    }
                    dp[0] = 0;
                }
                else
                {
                    long sum = 0;
                    for (int ii = n; ii > 0; ii--)
                    {
                        sum += dp[ii];
                        sum %= mod;
                        dp[ii] = sum;
                    }
                }
            }

            long ans = 0;
            for (int i = 0; i <= n; i++)
            {
                ans += dp[i];
            }
            return ans%mod;
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == 'f')
                    return 1;
                if (c == 's')
                    return 0;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}


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

namespace ConsoleApp12
{
    class Program
    {
        static void Main(string[] args)
        {

            const int size = 5001;
            int mod = 1000000007;
            int[] arr = new int[size], temparr = new int[size];
            arr[0] = 1;
            bool PrevIsF = false;
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; ++i)
            {
                char c = Console.ReadLine()[0];
                temparr = new int[size];
                if (c == 's')
                {
                    if (!PrevIsF)
                    {
                        int sum = 0;
                        for (int j = 0; j <= i + 1; ++j)
                        {
                            sum = (sum + arr[j]) % mod;
                        }
                        for (int j = 0; j <= i + 1; ++j)
                        {
                            temparr[j] = sum;
                            sum = (sum - arr[j]) % mod;
                            if (sum < 0) sum = mod + sum;
                        }
                        arr = temparr;
                    }
                    else
                    {
                        PrevIsF = false;
                    }
                }
                else
                {
                    if (PrevIsF)
                    {
                        for (int j = 0; j <= i; ++j) temparr[j + 1] = arr[j];
                    }
                    else
                    {
                        int sum = 0;
                        for (int j = 0; j <= i; ++j)
                        {

                            sum = (sum + arr[j]) % mod;
                        }
                        for (int j = 1; j <= i+1; ++j)
                        {
                            temparr[j] = sum;
                            sum = (sum - arr[j - 1]) % mod;
                            if (sum < 0) sum = sum + mod;
                        }
                    }
                    arr = temparr;
                    PrevIsF = true;
                }
            }
            int res=0;
            for (int i = 0; i < n; ++i) res = (res + arr[i]) % mod;
            Console.WriteLine(res);
        }
    }
}


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

namespace ConsoleApp12
{
    class Program
    {
        static void Main(string[] args)
        {

            const int size = 5001;
            int mod = 1000000007;
            int[] arr = new int[size], temparr = new int[size];
            arr[0] = 1;
            bool PrevIsF = false;
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; ++i)
            {
                char c = Console.ReadLine()[0];
                temparr = new int[size];
                if (c == 's')
                {
                    if (!PrevIsF)
                    {
                        int sum = 0;
                        for (int j = 0; j < i + 1; ++j)
                        {
                            sum = (sum + arr[j]) % mod;
                        }
                        for (int j = 0; j < i + 1; ++j)
                        {
                            temparr[j] = sum;
                            sum = (sum - arr[j]) % mod;
                            if (sum < 0) sum = mod + sum;
                        }
                        arr = temparr;
                    }
                    else
                    {
                        PrevIsF = false;
                    }
                }
                else
                {
                    if (PrevIsF)
                    {
                        for (int j = 0; j <= i; ++j) temparr[j + 1] = arr[j];
                    }
                    else
                    {
                        int sum = 0;
                        for (int j = 0; j <= i; ++j)
                        {

                            sum = (sum + arr[j]) % mod;
                        }
                        for (int j = 1; j <= i; ++j)
                        {
                            temparr[j] = sum;
                            sum = (sum - arr[j - 1]) % mod;
                            if (sum < 0) sum = sum + mod;
                        }
                    }
                    arr = temparr;
                    PrevIsF = true;
                }
            }
            int res=0;
            for (int i = 0; i < n; ++i) res = (res + arr[i]) % mod;
            Console.WriteLine(res);
        }
    }
}


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

namespace ConsoleApp12
{
    class Program
    {
        static void Main(string[] args)
        {
            const int size = 5001;
            int mod = 1000000007;
            int[] arr = new int[size], temparr = new int[size];
            arr[0] = 1;
            bool PrevIsF = false;
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; ++i)
            {
                char c = Console.ReadLine()[0];
                temparr = new int[size];
                if (c == 's')
                {
                    if (!PrevIsF)
                    {
                        for (int j = 0; j < i + 1; ++j)
                        {
                            int sum = 0;
                            for (int k = i + 1; k >= j; --k)
                                sum = (sum+ arr[k])%mod;
                            temparr[j] = sum;
                        }
                        arr = temparr;
                    }
                    else
                    {
                        PrevIsF = false;
                    }
                }
                else
                {
                    if (PrevIsF) {
                        for (int j = 0; j <= i; ++j) temparr[j + 1] = arr[j];
                    }
                    else
                    for (int j = 0; j <= i; ++j)
                    {
                        int sum = 0;
                        for (int k = i + 1; k >= j; --k)
                        {
                            sum = (sum + arr[k]) % mod;
                        }
                        temparr[j + 1] = sum;
                    }
                    arr = temparr;
                    PrevIsF = true;
                }
            }
            int res=0;
            for (int i = 0; i < n; ++i) res = (res + arr[i]) % mod;
            Console.WriteLine(res);
        }
    }
}


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

namespace ConsoleApp12
{
    class Program
    {
        static void Main(string[] args)
        {
            const int size = 10;
            int mod = 1000000007;
            int[] arr = new int[size], temparr = new int[size];
            arr[0] = 1;
            bool PrevIsF = false;
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; ++i)
            {
                char c = Console.ReadLine()[0];
                temparr = new int[size];
                if (c == 's')
                {
                    if (!PrevIsF)
                    {
                        for (int j = 0; j < i + 1; ++j)
                        {
                            int sum = 0;
                            for (int k = i + 1; k >= j; --k)
                                sum = (sum+ arr[k])%mod;
                            temparr[j] = sum;
                        }
                        arr = temparr;
                    }
                    else
                    {
                        PrevIsF = false;
                    }
                }
                else
                {
                    if (PrevIsF) {
                        for (int j = 0; j <= i; ++j) temparr[j + 1] = arr[j];
                    }
                    else
                    for (int j = 0; j <= i; ++j)
                    {
                        int sum = 0;
                        for (int k = i + 1; k >= j; --k)
                        {
                            sum = (sum + arr[k]) % mod;
                        }
                        temparr[j + 1] = sum;
                    }
                    arr = temparr;
                    PrevIsF = true;
                }
            }
            int res=0;
            for (int i = 0; i < n; ++i) res = (res + arr[i]) % mod;
            Console.WriteLine(res);
        }
    }
}


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

namespace ConsoleApp12
{
    class Program
    {
        static void Main(string[] args)
        {
            const int size = 10;
            int mod = 1000000007;
            int[] arr = new int[size], temparr = new int[size];
            arr[0] = 1;
            bool PrevIsF = false;
            int n = int.Parse(Console.ReadLine());
            for (int i = 0; i < n; ++i)
            {
                char c = Console.ReadLine()[0];
                temparr = new int[size];
                if (c == 's')
                {
                    if (!PrevIsF)
                    {
                        for (int j = 0; j < i + 1; ++j)
                        {
                            int sum = 0;
                            for (int k = i + 1; k >= j; --k)
                                sum = (sum+ arr[k])%mod;
                            temparr[j] = sum;
                        }
                        arr = temparr;
                    }
                    else
                    {
                        PrevIsF = false;
                    }
                }
                else
                {
                    PrevIsF = true;
                    for (int j = 0; j <= i; ++j)
                    {
                        int sum = 0;
                        for (int k = i + 1; k >= j; --k)
                        {
                            sum = (sum + arr[k]) % mod;
                        }
                        temparr[j + 1] = sum;
                    }
                    arr = temparr;
                }
            }
            int res=0;
            for (int i = 0; i < n; ++i) res = (res + arr[i]) % mod;
            Console.WriteLine(res);
        }
    }
}


using System;
using System.Linq;

namespace C_PythonIndentation
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var states = new long[n, n];

            for(int i=0;i< n; ++i)
            {
                for(int j=0;j< n; ++j)
                {
                    states[i, j] = 0;
                }
            }

            states[0, 0] = 1;
            var last = Console.ReadLine();

            for(int i=1;i< n; ++i)
            {
                var current = Console.ReadLine();
                if(last == "s")
                {
                    var totalSum = Enumerable.Range(0, n).Sum(j => states[i - 1, j]);
                    for (int j = 0; j < n; ++j)
                    {
                        states[i, j] = totalSum % (1000000007);
                        totalSum -= states[i - 1, j];
                    }
                }
                else
                {
                    for(int j=1;j< n; ++j)
                    {
                        states[i, j] = states[i - 1, j - 1] % (1000000007);
                    }
                }
                last = current;
            }

            Console.WriteLine(Enumerable.Range(0, n).Sum(j => states[n - 1, j])%(1000000007));
        }
    }
}


using System;
using System.Linq;

namespace C_PythonIndentation
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var states = new long[n, n];

            for(int i=0;i< n; ++i)
            {
                for(int j=0;j< n; ++j)
                {
                    states[i, j] = 0;
                }
            }

            states[0, 0] = 1;
            var last = Console.ReadLine();

            for(int i=1;i< n; ++i)
            {
                var current = Console.ReadLine();
                if(last == "s")
                {
                    var totalSum = Enumerable.Range(0, n).Sum(j => states[i - 1, j]);
                    for (int j = 0; j < n; ++j)
                    {
                        states[i, j] = totalSum;
                        totalSum -= states[i - 1, j];
                    }
                }
                else
                {
                    for(int j=1;j< n; ++j)
                    {
                        states[i, j] = states[i - 1, j - 1];
                    }
                }
                last = current;
            }

            Console.WriteLine(Enumerable.Range(0, n).Sum(j => states[n - 1, j])%(1000000007));
        }
    }
}


#include <stdio.h>

const int MOD = 1e9+7;

int n;
long long dt[5010][5010];
long long ans;

int main()
{
    char c, prev = 0;
    scanf("%d", &n);
    dt[0][0] = 1;
    for (int i = 1; i <= n; i++)
    {
        scanf(" %c", &c);
        if (prev == 'f')
            for (int j = 0; j < n; j++)
                dt[i][j] = dt[i-1][j-1];
        else
            for (int j = n-1; j >= 0; j--)
                dt[i][j] = (dt[i][j+1]+dt[i-1][j])%MOD;
        prev = c;
    }

    for (int i = 0; i < n; i++)
        ans = (ans+dt[n][i])%MOD;
    printf("%I64d\n", ans);
}


#include<stdio.h>
int dp[100005];
int main()
{
	long long mod=1e9+7;
	int n,e=1;
	scanf("%d",&n);
	getchar();
	dp[1]=1;
	for (int i=1;i<=n;i++)
	{
		char x;
		scanf("%c",&x);
		getchar();
		if (x=='f')
		{
			e++;
		}
		else
		{
			for (int j=1;j<=e;j++)
			{
				dp[j]=(dp[j]+dp[j-1])%mod;
			}
		}
	}
	printf("%d",dp[e]);
}


#include<stdio.h>
int main()
{
	int i,n;
	scanf("%d",&n);
	int type[n];
	int poss=0;
	int ans=1;
	int m=1e9+7;
	char ch[2];
	for(i=0;i<n;i++)
	{
		scanf("%s",ch);
		if(ch[0]=='f')
			type[i]=1;
		else
			type[i]=0;
		//printf("%d\n",i);
	}
	for(i=1;i<n;i++)
	{
		if(type[i-1]==1)
			poss+=1;
		else
			ans=(ans%m*(poss+1)%m)%m;
	}
	printf("%d\n",ans);
}


#include<stdio.h>
typedef long long ll;
ll dp[5005][5005];
int main()
{
	int i,n,j;
	scanf("%d",&n);
	ll type[n];
	ll poss=0,c=1,temp;
	ll ans=0;
	ll m=1e9+7;
	char ch[2];
	for(i=0;i<n;i++)
	{
		scanf("%s",ch);
		if(ch[0]=='f')
			type[i]=1;
		else
			type[i]=0;
	}
	dp[0][0]=1;
	if(type[0])
		poss++;
	for(i=1;i<n;i++)
	{
		if(type[i-1])
		{
			for(j=1;j<=poss;j++)
					dp[i][j]=dp[i-1][j-1]%m;
		}
		else
		{
			c=0;
			for(j=poss;j>=0;j--)
			{
				dp[i][j]=(c%m+dp[i-1][j]%m)%m;
				c=(c%m+dp[i-1][j]%m)%m;
			}
		}
		if(type[i])
			poss++;
	}
	for(i=0;i<=poss;i++)
	{
		ans=(ans%m+dp[n-1][i]%m)%m;
		//printf("%lld\n",ans);
	}
	printf("%lld\n",ans);
	return 0;
}


#include<stdio.h>
typedef long long ll;
ll dp[5005][5005];
int main()
{
	int i,n,j;
	scanf("%d",&n);
	ll type[n];
	ll poss=0,c=1,temp;
	ll ans=0;
	ll m=1e9+7;
	char ch[2];
	for(i=0;i<n;i++)
	{
		scanf("%s",ch);
		if(ch[0]=='f')
			type[i]=1;
		else
			type[i]=0;
	}
	dp[0][0]=1;
	if(type[0])
		poss++;
	for(i=1;i<n;i++)
	{
		if(type[i-1])
		{
			for(j=1;j<=poss;j++)
					dp[i][j]=dp[i-1][j-1];
		}
		else
		{
			c=0;
			for(j=0;j<=poss;j++)
				c=(c%m+dp[i-1][j]%m)%m;
			for(j=0;j<=poss;j++)
			{
				dp[i][j]=c;
				c=(c%m-dp[i-1][j]%m)%m;
			}
		}
		if(type[i])
			poss++;
	}
	for(i=0;i<=poss;i++)
	{
		ans=(ans+dp[n-1][i])%m;
		//printf("%lld\n",ans);
	}
	printf("%lld\n",ans);
	return 0;
}


#include<stdio.h>
typedef long long ll;
ll dp[5005][5005];
int main()
{
	int i,n,j;
	scanf("%d",&n);
	ll type[n];
	ll poss=0,c=1,temp;
	ll ans=0;
	ll m=1e9+7;
	char ch[2];
	for(i=0;i<n;i++)
	{
		scanf("%s",ch);
		if(ch[0]=='f')
			type[i]=1;
		else
			type[i]=0;
	}
	dp[0][0]=1;
	if(type[0])
		poss++;
	for(i=1;i<n;i++)
	{
		if(type[i-1])
		{
			for(j=1;j<=poss;j++)
					dp[i][j]=dp[i-1][j-1];
		}
		else
		{
			c=0;
			for(j=0;j<=poss;j++)
				c=(c%m+dp[i-1][j]%m)%m;
			for(j=0;j<=poss;j++)
			{
				dp[i][j]=c;
				c=(c%m-dp[i-1][j]%m)%m;
			}
		}
		if(type[i])
			poss++;
	}
	for(i=0;i<=poss;i++)
	{
		ans=(ans%m+dp[n-1][i]%m)%m;
		//printf("%lld\n",ans);
	}
	printf("%lld\n",ans);
	return 0;
}


#include <stdio.h>
// #define fori
#define MAX_SIZE 5000
#define RESMOD (1000000000 + 7)

void printd(int d[MAX_SIZE][MAX_SIZE], int n) {
	for(int i=0; i<n; i++) {
		for (int j=0; j<n; j++) {
			printf("%d ", d[i][j]);
		}
		printf("\n");
	}
}
int main() {

	int n;
	char p[MAX_SIZE];

	scanf("%d", &n);

	int i;
	for ( i=0; i<n; i++) {
		// p[i] = getchar();
		scanf(" %c", &p[i]);
	}
	// p[i+1] = '\0';

	static int dp[MAX_SIZE][MAX_SIZE];

	for (int i=0; i<MAX_SIZE; i++) {
		for (int j=0; j<MAX_SIZE; j++) {
			dp[i][j] = 0;
		}
	}

	int indent = 0;

	dp[0][0] = 1;

	// printd(dp, n);

	for (i=1; i<n; i++) {
		if (p[i-1] == 'f') {
			indent = indent + 1;
			for (int j=1; j<indent+1; j++) {
				dp[i][j] = dp[i-1][j-1] % RESMOD;
			}
		}
		else {
			dp[i][indent] = dp[i-1][indent];
			int suffix = 0;

			for (int j=indent; j>=0; j--) {
				suffix = (suffix + dp[i-1][j]) % RESMOD;
				dp[i][j] = suffix % RESMOD;
	 		}
		}
	}

	// printd(dp, n);

	int r = 0;
	for (int j=0; j<n+1; j++) {
		r = (r + dp[n-1][j]) % RESMOD;
	}

	printf("%d\n", r);

}


#include <stdio.h>
// #define fori
#define MAX_SIZE 5000
#define RESMOD (1000000000 + 7)

void printd(int d[MAX_SIZE][MAX_SIZE], int n) {
	for(int i=0; i<n; i++) {
		for (int j=0; j<n; j++) {
			printf("%d ", d[i][j]);
		}
		printf("\n");
	}
}
int main() {
	int n;
	char p[MAX_SIZE];

	scanf("%d", &n);

	int i;
	for ( i=0; i<n; i++) {
		// p[i] = getchar();
		scanf(" %c", &p[i]);
	}
	// p[i+1] = '\0';

	static int dp[MAX_SIZE][MAX_SIZE];

	for (int i=0; i<MAX_SIZE; i++) {
		for (int j=0; j<MAX_SIZE; j++) {
			dp[i][j] = 0;
		}
	}

	int indent = 0;

	dp[0][0] = 1;

	// printd(dp, n);

	for (i=1; i<n; i++) {
		if (p[i-1] == 'f') {
			indent = indent + 1;
			for (int j=1; j<indent+1; j++) {
				dp[i][j] = dp[i-1][j-1];
			}
		}
		else {
			dp[i][indent] = dp[i-1][indent];
			int suffix = 0;

			for (int j=indent; j>=0; j--) {
				suffix = suffix + dp[i-1][j];
				dp[i][j] = suffix;
			}
		}
	}

	// printd(dp, n);

	int r = 0;
	for (int j=0; j<n+1; j++) {
		r = r + dp[n-1][j];
	}

	printf("%d\n", r % RESMOD);

}


#include <stdio.h>
#define MAXN 5004
#define MOD (ll)(1e9+7)
#define ll long long
int n, x, pre;
ll d[MAXN][MAXN];
int main(){
	scanf("%d", &n);
	d[0][1] = 1;
	for (int i = 1; i <= n; i++){
		scanf("%s", &x);
		if (pre == 'f'){
			for (int j = 1; j < n; j++)	d[i][j + 1] = d[i - 1][j];
		}
		else {
			for (int j = n-1; j >= 1; j--){
				d[i][j] += d[i][j+1]+d[i-1][j];
				d[i][j] %= MOD;
			}
		}
		pre = x;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		ans += d[n][i];
		ans %= MOD;
	}
	printf("%lld", ans);
}


#include <stdio.h>
#define MAXN 5004
#define MOD (ll)(1e9+7)
#define ll long long
int n, x, pre;
ll d[MAXN][MAXN];
int main(){
	scanf("%d", &n);
	d[0][1] = 1;
	for (int i = 1; i <= n; i++){
		scanf("%s", &x);
		if (pre == 'f'){
			for (int j = 1; j < n; j++)	d[i][j + 1] = d[i - 1][j];
		}
		else {
			for (int j = n; j >= 1; j--){
				d[i][j] += d[i][j+1]+d[i-1][j];
				d[i][j] %= MOD;
			}
		}
		pre = x;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		ans += d[n][i];
		ans %= MOD;
	}
	printf("%lld", ans);
}


#include <stdio.h>
#define MAXN 5004
#define ll long long
int n, x, pre;
ll d[MAXN][MAXN];
int main(){
	scanf("%d", &n);
	d[0][1] = 1;
	for (int i = 1; i <= n; i++){
		scanf("%s", &x);
		if (pre == 'f'){
			for (int j = 1; j < n; j++)	d[i][j + 1] = d[i - 1][j];
		}
		else{
			for (int j = n-1; j >= 1; j--){
				d[i][j] += d[i][j+1]+d[i-1][j];
			}
		}
		pre = x;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++) ans += d[n][i];
	printf("%lld", ans);
}


#include <stdio.h>

#define MOD 1000000007

int main_dp[5000] = {0};

int main() {
	int n;
	scanf("%d", &n);
	int i,j;
	char read[10];
	char last_state;
	char state;
	scanf("%s", read);
	last_state = read[0];
	main_dp[0] = 1;

	for(i=1;i<n;++i) {
		int dp[5000] = {0};
		int counts[5000] = {0};
		scanf("%s", read);
		state = read[0];
		if(last_state == 's') {
			counts[n-1] = main_dp[n-1];
			for(j=n-2;j>=0;j--) {
				counts[j] = (counts[j+1] + main_dp[j])%MOD;
			}
			for(j=0;j<n;j++) {
				dp[j] = counts[j];
			}
		} else if(last_state == 'f') {
			for(j=1;j<n;j++) {
				dp[j] = main_dp[j-1];
			}
		}
		for(j=0;j<n;j++) {
			main_dp[j] = dp[j];
		}
		last_state = state;
	}
	int sum = 0;
	for(j=0;j<n;j++) {
		sum = (sum + main_dp[j])%MOD;
	}
	printf("%d\n", sum);
	return 0;
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
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;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C909 solver = new C909();
        solver.solve(1, in, out);
        out.close();
    }

    static class C909 {
        int N;
        long MOD = 1_000_000_007;
        boolean[] type;
        long[][] memo;

        long dp(int cmd, int dep) {
            // safe if we came out of a statement, we can traverse
            if (dep < 0) return 0;
            if (cmd == N) return 1;
            if (memo[cmd][dep] != -1) return memo[cmd][dep];

            boolean safe = cmd == 0 ? true : !type[cmd - 1];
            int d = type[cmd] ? 1 : 0;

            long ways = 0;
            if (!safe) {
                // we must use this indentation
                ways += dp(cmd + 1, dep + d);
                ways %= MOD;
            } else {
                ways += dp(cmd + 1, dep + d);
                ways %= MOD;
                ways += dp(cmd, dep - 1);
                ways %= MOD;
            }

            return memo[cmd][dep] = ways;
        }

        public void solve(int testNumber, FastScanner s, PrintWriter out) {
            N = s.nextInt();
            type = new boolean[N];
            for (int i = 0; i < N; i++) {
                type[i] = s.next().charAt(0) == 'f';
            }

            memo = new long[N][N + 1];
            for (long[] a : memo)
                Arrays.fill(a, -1);

            out.println(dp(0, 0));

        }

    }

    static class FastScanner {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public FastScanner(InputStream stream) {
            this.stream = stream;
        }

        int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
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;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C909 solver = new C909();
        solver.solve(1, in, out);
        out.close();
    }

    static class C909 {
        int N;
        long MOD = 1_000_000_007;
        boolean[] type;
        long[][][] memo;

        long dp(int cmd, int dep, boolean safe) {
            // safe if we did not just come out of a for (free to traverse lower depths)
            if (cmd == N) return 1;
            if (memo[cmd][dep][safe ? 1 : 0] != -1) return memo[cmd][dep][safe ? 1 : 0];

            long ways = 0;
            if (type[cmd]) {
                // statement
                if (!safe) {
                    return memo[cmd][dep][safe ? 1 : 0] = dp(cmd + 1, dep, true);
                }
                for (int nd = 0; nd <= dep; nd++) {
                    ways += dp(cmd + 1, nd, true);
                    ways %= MOD;
                }
            } else {
                // for
                if (!safe) {
                    return memo[cmd][dep][safe ? 1 : 0] = dp(cmd + 1, dep + 1, false);
                }
                for (int nd = 0; nd <= dep; nd++) {
                    ways += dp(cmd + 1, nd + 1, false);
                    ways %= MOD;
                }
            }

            return memo[cmd][dep][safe ? 1 : 0] = ways;
        }

        public void solve(int testNumber, FastScanner s, PrintWriter out) {
            N = s.nextInt();
            type = new boolean[N];
            for (int i = 0; i < N; i++) {
                type[i] = s.next().toCharArray()[0] == 's';
            }

            memo = new long[N][N + 1][2];
            for (long[][] a : memo)
                for (long[] b : a)
                    Arrays.fill(b, -1);

            out.println(dp(0, 0, false));

        }

    }

    static class FastScanner {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public FastScanner(InputStream stream) {
            this.stream = stream;
        }

        int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
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;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C909 solver = new C909();
        solver.solve(1, in, out);
        out.close();
    }

    static class C909 {
        int N;
        boolean[] type;
        long[][][] memo;

        long dp(int cmd, int dep, boolean safe) {
            // safe if we did not just come out of a for (free to traverse lower depths)
            if (cmd == N) return 1;
            if (memo[cmd][dep][safe ? 1 : 0] != -1) return memo[cmd][dep][safe ? 1 : 0];

            long ways = 0;
            if (type[cmd]) {
                // statement
                if (!safe) {
                    return memo[cmd][dep][safe ? 1 : 0] = dp(cmd + 1, dep, true);
                }
                for (int nd = 0; nd <= dep; nd++) {
                    ways += dp(cmd + 1, nd, true);
                }
            } else {
                // for
                if (!safe) {
                    return memo[cmd][dep][safe ? 1 : 0] = dp(cmd + 1, dep + 1, false);
                }
                for (int nd = 0; nd <= dep; nd++) {
                    ways += dp(cmd + 1, nd + 1, false);
                }
            }

            return memo[cmd][dep][safe ? 1 : 0] = ways;
        }

        public void solve(int testNumber, FastScanner s, PrintWriter out) {
            N = s.nextInt();
            type = new boolean[N];
            for (int i = 0; i < N; i++) {
                type[i] = s.next().toCharArray()[0] == 's';
            }

            memo = new long[N][N + 1][2];
            for (long[][] a : memo)
                for (long[] b : a)
                    Arrays.fill(b, -1);

            out.println(dp(0, 0, true));

        }

    }

    static class FastScanner {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public FastScanner(InputStream stream) {
            this.stream = stream;
        }

        int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
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;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C909 solver = new C909();
        solver.solve(1, in, out);
        out.close();
    }

    static class C909 {
        int N;
        boolean[] type;
        long[][][] memo;

        long dp(int cmd, int dep, boolean safe) {
            // safe if we did not just come out of a for
            if (cmd == N) return 1;
            if (memo[cmd][dep][safe ? 1 : 0] != -1) return memo[cmd][dep][safe ? 1 : 0];

            long ways = 0;
            if (type[cmd]) {
                // statement
                if (!safe) {
                    return memo[cmd][dep][safe ? 1 : 0] = dp(cmd + 1, dep, true);
                }
                for (int nd = 0; nd <= dep; nd++) {
                    ways += dp(cmd + 1, nd, true);
                }
            } else {
                // for
                if (!safe) {
                    return memo[cmd][dep][safe ? 1 : 0] = dp(cmd + 1, dep + 1, false);
                }
                for (int nd = 0; nd <= dep; nd++) {
                    ways += dp(cmd + 1, nd + 1, false);
                }
            }

            return memo[cmd][dep][safe ? 1 : 0] = ways;
        }

        public void solve(int testNumber, FastScanner s, PrintWriter out) {
            N = s.nextInt();
            type = new boolean[N];
            for (int i = 0; i < N; i++) {
                type[i] = s.next().toCharArray()[0] == 's';
            }

            memo = new long[N][N + 1][2];
            for (long[][] a : memo)
                for (long[] b : a)
                    Arrays.fill(b, -1);

            out.println(dp(0, 0, true));

        }

    }

    static class FastScanner {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public FastScanner(InputStream stream) {
            this.stream = stream;
        }

        int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
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;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C909 solver = new C909();
        solver.solve(1, in, out);
        out.close();
    }

    static class C909 {
        int N;
        boolean[] type;
        long[][][] memo;

        long dp(int cmd, int dep, boolean safe) {
            // safe if we did not just come out of a for
            if (cmd == N) return 1;
            if (memo[cmd][dep][safe ? 1 : 0] != -1) return memo[cmd][dep][safe ? 1 : 0];

            long ways = 0;
            if (type[cmd]) {
                // statement
                if (!safe) {
                    return memo[cmd][dep][safe ? 1 : 0] = dp(cmd + 1, dep + 1, true);
                }
                for (int nd = 0; nd <= dep; nd++) {
                    ways += dp(cmd + 1, nd, true);
                }
            } else {
                // for
                if (!safe) {
                    return memo[cmd][dep][safe ? 1 : 0] = dp(cmd + 1, dep + 1, false);
                }
                for (int nd = 0; nd <= dep; nd++) {
                    ways += dp(cmd + 1, nd, false);
                }
            }

            return memo[cmd][dep][safe ? 1 : 0] = ways;
        }

        public void solve(int testNumber, FastScanner s, PrintWriter out) {
            N = s.nextInt();
            type = new boolean[N];
            for (int i = 0; i < N; i++) {
                type[i] = s.next().toCharArray()[0] == 's';
            }

            memo = new long[N][N + 1][2];
            for (long[][] a : memo)
                for (long[] b : a)
                    Arrays.fill(b, -1);

            out.println(dp(0, 0, true));

        }

    }

    static class FastScanner {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public FastScanner(InputStream stream) {
            this.stream = stream;
        }

        int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

    }
}


/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */

public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		String s="";
		for(int i=0;i<n;i++){
			String ln=scan.next();
			s+=ln.charAt(0);
		}
		Python py=new Python();
		py.n=n;
		py.s=s;
		py.init();
		System.out.println(py.f(0,0));
	}
}

class Python{
	String s;
	int n;
	int[] count=new int[5001];
	long[][] dp=new long[5001][5001];
	long P=1000000007;

	void init(){
		count[0]=((s.charAt(0)=='f')?1:0);
		for(int i=1;i<n;i++){
			count[i]=count[i-1]+((s.charAt(i)=='f')?1:0);
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				dp[i][j]=-1;
			}
		}
		//for(int i=0;i<n;i++){System.out.println(count[i]);}
	}

	long f(int op,int p){
		//System.out.println(p);
		if(op<0){return 0;}
		if(p==n){
			if(s.charAt(n-1)!='f'){return 1;}
			else{return 0;}
		}
		long res=dp[op][p];
		if(res!=-1){return res;}
		res=0;
		if(p>0 && s.charAt(p-1)=='f'){
			if(s.charAt(p)=='s'){
				res=f(op,p+1);
			}
			else{
				res=f(op+1,p+1);
			}
		}
		else{
			//res=0;
			if(s.charAt(p)=='s'){
				for(int i=op;i>=0;i--){
					res=(res+f(i,p+1))%P;
				}
			}
			else{
				for(int i=op;i>=0;i--){
					res=(res+f(i+1,p+1))%P;
				}
			}
		}
		dp[op][p]=res;
		return res;
	}
}


/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */

public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		String s="";
		for(int i=0;i<n;i++){
			String ln=scan.next();
			s+=ln.charAt(0);
		}
		Python py=new Python();
		py.n=n;
		py.s=s;
		py.init();
		System.out.println(py.f(0,0));
	}
}

class Python{
	String s;
	int n;
	int[] count=new int[5001];
	long[][] dp=new long[5001][5001];
	long P=1000000007;

	void init(){
		count[0]=((s.charAt(0)=='f')?1:0);
		for(int i=1;i<n;i++){
			count[i]=count[i-1]+((s.charAt(i)=='f')?1:0);
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				dp[i][j]=-1;
			}
		}
		//for(int i=0;i<n;i++){System.out.println(count[i]);}
	}

	long f(int op,int p){
		//System.out.println(p);
		if(op<0){return 0;}
		if(p==n){
			if(s.charAt(n-1)!='f'){return 1;}
			else{return 0;}
		}
		long res=dp[op][p];
		if(res!=-1){return res;}
		res=0;
		if(p>0 && s.charAt(p-1)=='f'){
			if(s.charAt(p)=='s'){
				res=f(op,p+1);
			}
			else{
				res=f(op+1,p+1);
			}
		}
		else{
			//res=0;
			if(s.charAt(p)=='s'){
				res=(f(op,p+1)+f(op-1,p))%P;
			}
			else{
				res=(f(op+1,p+1)+f(op-1,p))%P;
			}
		}
		dp[op][p]=res;
		return res;
	}
}


/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */

public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		String s="";
		for(int i=0;i<n;i++){
			String ln=scan.next();
			s+=ln.charAt(0);
		}
		Python py=new Python();
		py.n=n;
		py.s=s;
		py.init();
		System.out.println(py.f(0,0));
	}
}

class Python{
	String s;
	int n;
	int[] count=new int[5001];
	long[][] dp=new long[5001][5001];

	void init(){
		count[0]=((s.charAt(0)=='f')?1:0);
		for(int i=1;i<n;i++){
			count[i]=count[i-1]+((s.charAt(i)=='f')?1:0);
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				dp[i][j]=-1;
			}
		}
		//for(int i=0;i<n;i++){System.out.println(count[i]);}
	}

	long f(int op,int p){
		//System.out.println(p);
		if(op<0){return 0;}
		if(p==n){
			if(s.charAt(n-1)!='f'){return 1;}
			else{return 0;}
		}
		long res=dp[op][p];
		if(res!=-1){return res;}
		res=0;
		if(p>0 && s.charAt(p-1)=='f'){
			if(s.charAt(p)=='s'){
				res+=f(op,p+1);
			}
			else{
				res+=f(op+1,p+1);
			}
		}
		else{
			//res=0;
			if(s.charAt(p)=='s'){
				for(int i=op;i>=0;i--){
					res+=f(i,p+1);
				}
			}
			else{
				for(int i=op;i>=0;i--){
					res+=f(i+1,p+1);
				}
			}
		}
		dp[op][p]=res;
		return res;
	}
}


import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(in.readLine());
        int[] dp = new int[n+2];
        int depth = 1;
        int mod = (int)1e9+7;
        dp[1] = 1;
        for (int i = 1; i <= n; i++) {
            String string = in.readLine();
            if (string.equals("f")) {
                depth++;
            } else {
                for (int j = 1; j <= depth; j++) {
                    dp[j] += dp[j-1];
                    dp[j] %= mod;
                }
            }
        }
        System.out.println(dp[depth]);
    }

}

/*
8
f
s
f
f
s
f
s
s
 */


import java.io.*;
import java.util.*;

public class Main {

    static int n;
    static char[] a;

    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        n = Integer.parseInt(in.readLine());
        a = new char[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.readLine().charAt(0);
        }
        System.out.println(recur(0, 0, 1));
    }

    static int recur(int pos, int depth, int endedWithS) {
        if (pos == n-1) {
            //System.out.println("base case & depth=" + depth + " endedwiths=" + endedWithS);
            if (endedWithS == 0) {
                return 1;
            } else {
                int res = 0;
                for (int d = 0; d <= depth; d++) {
                    res++;
                }
                return res;
            }
        }
        //System.out.println("pos=" + pos + " depth=" + depth  +" endedwithS=" + endedWithS + " char=" + a[pos]);
        if (a[pos] == 's') {
            //System.out.println("Got S");
            if (endedWithS == 0) {
                return recur(pos+1, depth, 0);
            } else {
                int res = 0;
                for (int d = 0; d <= depth; d++) {
                    res += recur(pos+1, d, 0);
                }
                return res;
            }
        }
        if (a[pos] == 'f') {
            //System.out.println("Got F");
            if (endedWithS == 0) {
                return recur(pos+1, depth+1, 0);
            } else {
                int res = 0;
                for (int d = 0; d <= depth+1; d++) {
                    res += recur(pos+1, d, 0);
                }
                return res;
            }
        }
        //System.out.println("this shouldnt happen");
        return Integer.MAX_VALUE;
    }
}

/*

 */


import java.io.*;
import java.util.*;

public class Main {

    static int n;
    static char[] a;

    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        n = Integer.parseInt(in.readLine());
        a = new char[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.readLine().charAt(0);
        }
        System.out.println(recur(0, 0));
    }

    static int mod = (int) (1e9+7);
    static int[][] cache = new int[5005][5005];
    static int recur(int pos, int depth) {
        if (pos == n-1) {
            return 1;
        }
        if (cache[pos][depth] != 0){
            return cache[pos][depth];
        }
        //System.out.println("pos=" + pos + " depth=" + depth  + " char=" + a[pos]);
        if (a[pos] == 's') {
          //  System.out.println("Got S");
            int res = 0;
            for (int d = 0; d <= depth; d++) {
                res += recur(pos+1, d);
                res %= mod;
            }
            cache[pos][depth] = res;
            return res;
        }
        if (a[pos] == 'f') {
          //  System.out.println("Got F");
            cache[pos][depth] = recur(pos+1, depth+1);
            cache[pos][depth] %= mod;
            return cache[pos][depth];
        }
       // System.out.println("this shouldnt happen");
        return Integer.MAX_VALUE;
    }
}

/*
8
f
s
f
f
s
f
s
s
 */


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class C {

	public static void main(String[] args){
		FastScanner scan = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		n = scan.nextInt(); mod = (int)1e9+7;
		in = new char[n];
		for(int i = 0; i < n; i++) in[i] = scan.next().charAt(0);
		dp = new Long[n][n];
		out.println(go(0, 0)/2);
		out.close();
	}

	static long go(int at, int i) {
		if(at == n) return 1;
		if(dp[at][i] != null) return dp[at][i];
		long res = 0;
		if(in[at] == 's') {
			res += go(at+1, i);
			res %= mod;
			if(i > 0) {
				res += go(at+1, i-1);
				res %= mod;
			}
		} else {
			res += go(at+1, i+1);
			res %= mod;
		}
		return dp[at][i] = res;
	}

	static Long[][] dp;
	static int n, mod;
	static char[] in;

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			try	{
				br = new BufferedReader(new InputStreamReader(System.in));
				st = new StringTokenizer(br.readLine());
			} catch (Exception e){e.printStackTrace();}
		}

		public String next() {
			if (st.hasMoreTokens())	return st.nextToken();
			try {st = new StringTokenizer(br.readLine());}
			catch (Exception e) {e.printStackTrace();}
			return st.nextToken();
		}

		public int nextInt() {return Integer.parseInt(next());}

		public long nextLong() {return Long.parseLong(next());}

		public double nextDouble() {return Double.parseDouble(next());}

		public String nextLine() {
			String line = "";
			if(st.hasMoreTokens()) line = st.nextToken();
			else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
			while(st.hasMoreTokens()) line += " "+st.nextToken();
			return line;
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n){
			long[] a = new long[n];
			for(int i = 0; i < n; i++) a[i] = nextLong();
			return a;
		}

		public double[] nextDoubleArray(int n){
			double[] a = new double[n];
			for(int i = 0; i < n; i++) a[i] = nextDouble();
			return a;
		}

		public char[][] nextGrid(int n, int m){
			char[][] grid = new char[n][m];
			for(int i = 0; i < n; i++) grid[i] = next().toCharArray();
			return grid;
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class C {

	public static void main(String[] args){
		FastScanner scan = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		n = scan.nextInt(); mod = (int)1e9+7;
		in = new char[n];
		for(int i = 0; i < n; i++) in[i] = scan.next().charAt(0);
		dp = new Long[n][n];
		out.println(go(0, 0));
		out.close();
	}

	static long go(int at, int i) {
		if(at == n-1) return 1;
		if(dp[at][i] != null) return dp[at][i];
		long res = 0;
		if(in[at] == 's') {
			res += go(at+1, i);
			res %= mod;
			if(i > 0) {
				res += go(at, i-1);
				res %= mod;
			}
		} else {
			res += go(at+1, i+1);
			res %= mod;
		}
		return dp[at][i] = res;
	}

	static Long[][] dp;
	static int n, mod;
	static char[] in;

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			try	{
				br = new BufferedReader(new InputStreamReader(System.in));
				st = new StringTokenizer(br.readLine());
			} catch (Exception e){e.printStackTrace();}
		}

		public String next() {
			if (st.hasMoreTokens())	return st.nextToken();
			try {st = new StringTokenizer(br.readLine());}
			catch (Exception e) {e.printStackTrace();}
			return st.nextToken();
		}

		public int nextInt() {return Integer.parseInt(next());}

		public long nextLong() {return Long.parseLong(next());}

		public double nextDouble() {return Double.parseDouble(next());}

		public String nextLine() {
			String line = "";
			if(st.hasMoreTokens()) line = st.nextToken();
			else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
			while(st.hasMoreTokens()) line += " "+st.nextToken();
			return line;
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n){
			long[] a = new long[n];
			for(int i = 0; i < n; i++) a[i] = nextLong();
			return a;
		}

		public double[] nextDoubleArray(int n){
			double[] a = new double[n];
			for(int i = 0; i < n; i++) a[i] = nextDouble();
			return a;
		}

		public char[][] nextGrid(int n, int m){
			char[][] grid = new char[n][m];
			for(int i = 0; i < n; i++) grid[i] = next().toCharArray();
			return grid;
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class C {

	public static void main(String[] args){
		FastScanner scan = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		n = scan.nextInt(); mod = (int)1e9+7;
		in = new char[n];
		for(int i = 0; i < n; i++) in[i] = scan.next().charAt(0);
		dp = new Long[n][n];
		out.println(go(0, 0));
		out.close();
	}

	static long go(int at, int i) {
		if(at == n-1) return 1;
		if(dp[at][i] != null) return dp[at][i];
		long res = 0;
		if(in[at] == 's') {
			res += go(at+1, i);
			res %= mod;
			if(i > 0) {
				res += go(at+1, i-1);
				res %= mod;
			}
		} else {
			res += go(at+1, i+1);
			res %= mod;
		}
		return dp[at][i] = res;
	}

	static Long[][] dp;
	static int n, mod;
	static char[] in;

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			try	{
				br = new BufferedReader(new InputStreamReader(System.in));
				st = new StringTokenizer(br.readLine());
			} catch (Exception e){e.printStackTrace();}
		}

		public String next() {
			if (st.hasMoreTokens())	return st.nextToken();
			try {st = new StringTokenizer(br.readLine());}
			catch (Exception e) {e.printStackTrace();}
			return st.nextToken();
		}

		public int nextInt() {return Integer.parseInt(next());}

		public long nextLong() {return Long.parseLong(next());}

		public double nextDouble() {return Double.parseDouble(next());}

		public String nextLine() {
			String line = "";
			if(st.hasMoreTokens()) line = st.nextToken();
			else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
			while(st.hasMoreTokens()) line += " "+st.nextToken();
			return line;
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n){
			long[] a = new long[n];
			for(int i = 0; i < n; i++) a[i] = nextLong();
			return a;
		}

		public double[] nextDoubleArray(int n){
			double[] a = new double[n];
			for(int i = 0; i < n; i++) a[i] = nextDouble();
			return a;
		}

		public char[][] nextGrid(int n, int m){
			char[][] grid = new char[n][m];
			for(int i = 0; i < n; i++) grid[i] = next().toCharArray();
			return grid;
		}
	}

}


import java.io.*;
import java.util.*;
import java.util.stream.Stream;

public class Main implements Runnable {
    static final int MOD = (int) 1e9 + 7;
    static final int MI = (int) 1e9;
    static final long ML = (long) 1e18;
    static final Reader in = new Reader();
    static final PrintWriter out = new PrintWriter(System.out);
    StringBuilder answer = new StringBuilder();

    public static void main(String[] args) {
        new Thread(null, new Main(), "persefone", 1 << 28).start();
    }

    @Override
    public void run() {
        solve();
        printf();
        flush();
    }

    void solve() {
        int n = in.nextInt();
        char[] type = new char[n];
        for (int i = 0; i < n; i++) type[i] = in.next().charAt(0);
        int[] dp = new int[n];
        dp[0] = 1;
        for (int i = 1; i < n; i++) {
            int[] ndp = new int[n];
            if (type[i - 1] == 'f') {
                ndp[0] = 0;
                for (int j = 1; j <= i; j++) ndp[j] = (ndp[j] + dp[j - 1]) % MOD;
            } else {
                ndp[i - 1] = dp[i - 1];
                for (int j = i - 2; j > -1; j--) ndp[j] = (ndp[j + 1] + dp[j]) % MOD;
            }
            dp = ndp;
        }
        int ans = 0;
        for (int i = 0; i < n; i++) ans = (ans + dp[i]) % MOD;
        printf(ans);
    }

    void printf() {
        out.print(answer);
    }

    void close() {
        out.close();
    }

    void flush() {
        out.flush();
    }

    void printf(Stream<?> str) {
        str.forEach(o -> add(o, " "));
        add("\n");
    }

    void printf(Object... obj) {
        printf(false, obj);
    }

    void printfWithDescription(Object... obj) {
        printf(true, obj);
    }

    private void printf(boolean b, Object... obj) {

        if (obj.length > 1) {
            for (int i = 0; i < obj.length; i++) {
                if (b) add(obj[i].getClass().getSimpleName(), " - ");
                if (obj[i] instanceof Collection<?>) {
                    printf((Collection<?>) obj[i]);
                } else if (obj[i] instanceof int[][]) {
                    printf((int[][]) obj[i]);
                } else if (obj[i] instanceof long[][]) {
                    printf((long[][]) obj[i]);
                } else if (obj[i] instanceof double[][]) {
                    printf((double[][]) obj[i]);
                } else printf(obj[i]);
            }
            return;
        }

        if (b) add(obj[0].getClass().getSimpleName(), " - ");
        printf(obj[0]);
    }

    void printf(Object o) {
        if (o instanceof int[])
            printf(Arrays.stream((int[]) o).boxed());
        else if (o instanceof char[])
            printf(new String((char[]) o));
        else if (o instanceof long[])
            printf(Arrays.stream((long[]) o).boxed());
        else if (o instanceof double[])
            printf(Arrays.stream((double[]) o).boxed());
        else if (o instanceof boolean[]) {
            for (boolean b : (boolean[]) o) add(b, " ");
            add("\n");
        } else
            add(o, "\n");
    }

    void printf(int[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(long[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(double[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(boolean[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(Collection<?> col) {
        printf(col.stream());
    }

    <T, K> void add(T t, K k) {
        if (t instanceof Collection<?>) {
            ((Collection<?>) t).forEach(i -> add(i, " "));
        } else if (t instanceof Object[]) {
            Arrays.stream((Object[]) t).forEach(i -> add(i, " "));
        } else
            add(t);
        add(k);
    }

    <T> void add(T t) {
        answer.append(t);
    }

    @SuppressWarnings("unchecked")
    <T extends Comparable<? super T>> T min(T... t) {
        if (t.length == 0)
            return null;
        T m = t[0];
        for (int i = 1; i < t.length; i++)
            if (t[i].compareTo(m) < 0)
                m = t[i];
        return m;
    }

    @SuppressWarnings("unchecked")
    <T extends Comparable<? super T>> T max(T... t) {
        if (t.length == 0)
            return null;
        T m = t[0];
        for (int i = 1; i < t.length; i++)
            if (t[i].compareTo(m) > 0)
                m = t[i];
        return m;
    }

    static class Pair<K extends Comparable<? super K>, V extends Comparable<? super V>>
            implements Comparable<Pair<K, V>> {
        private K k;
        private V v;

        Pair(K k, V v) {
            this.k = k;
            this.v = v;
        }

        @SuppressWarnings("unchecked")
        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || !(o instanceof Pair)) return false;
            Pair<K, V> p = (Pair<K, V>) o;
            return k.compareTo(p.k) == 0 && v.compareTo(p.v) == 0;
        }

        @Override
        public int hashCode() {
            int hash = 31;
            hash = hash * 89 + k.hashCode();
            hash = hash * 89 + v.hashCode();
            return hash;
        }

        @Override
        public int compareTo(Pair<K, V> pair) {
            return k.compareTo(pair.k) == 0 ? v.compareTo(pair.v) : k.compareTo(pair.k);
        }

        @Override
        public Pair<K, V> clone() {
            return new Pair<K, V>(this.k, this.v);
        }

        @Override
        public String toString() {
            return String.valueOf(k).concat(" ").concat(String.valueOf(v)).concat("\n");
        }
    }

    static class Reader {
        private BufferedReader br;
        private StringTokenizer st;

        Reader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            try {
                while (st == null || !st.hasMoreTokens()) {
                    st = new StringTokenizer(br.readLine());
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
                arr[i] = nextInt();
            return arr;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Stream;

public class Main implements Runnable {
    static final int MOD = (int) 1e9 + 7;
    static final int MI = (int) 1e9;
    static final long ML = (long) 1e18;
    static final Reader in = new Reader();
    static final PrintWriter out = new PrintWriter(System.out);
    StringBuilder answer = new StringBuilder();

    public static void main(String[] args) {
        new Thread(null, new Main(), "persefone", 1 << 28).start();
    }

    @Override
    public void run() {
        solve();
        printf();
        flush();
    }

    void solve() {
        int n = in.nextInt();
        char[] type = new char[n + 1];
        type[n] = 'f';
        for (int i = 0; i < n; i++) type[i] = in.next().charAt(0);
        int[] dp = new int[n + 1];
        dp[n] = 1;
        for (int i = n - 1; i > -1; i--) {
            dp[i] = dp[i + 1];
            if (type[i] == 'f') {
                dp[i] = 0;
                for (int j = i + 1; j <= n; j++) {
                    if (type[j] == 'f' && type[j - 1] == 's') {
                        dp[i] = (dp[i] + dp[j]) % MOD;
                    }
                }
            }
        }
        printf(dp[0]);
    }

    void printf() {
        out.print(answer);
    }

    void close() {
        out.close();
    }

    void flush() {
        out.flush();
    }

    void printf(Stream<?> str) {
        str.forEach(o -> add(o, " "));
        add("\n");
    }

    void printf(Object... obj) {
        printf(false, obj);
    }

    void printfWithDescription(Object... obj) {
        printf(true, obj);
    }

    private void printf(boolean b, Object... obj) {

        if (obj.length > 1) {
            for (int i = 0; i < obj.length; i++) {
                if (b) add(obj[i].getClass().getSimpleName(), " - ");
                if (obj[i] instanceof Collection<?>) {
                    printf((Collection<?>) obj[i]);
                } else if (obj[i] instanceof int[][]) {
                    printf((int[][]) obj[i]);
                } else if (obj[i] instanceof long[][]) {
                    printf((long[][]) obj[i]);
                } else if (obj[i] instanceof double[][]) {
                    printf((double[][]) obj[i]);
                } else printf(obj[i]);
            }
            return;
        }

        if (b) add(obj[0].getClass().getSimpleName(), " - ");
        printf(obj[0]);
    }

    void printf(Object o) {
        if (o instanceof int[])
            printf(Arrays.stream((int[]) o).boxed());
        else if (o instanceof char[])
            printf(new String((char[]) o));
        else if (o instanceof long[])
            printf(Arrays.stream((long[]) o).boxed());
        else if (o instanceof double[])
            printf(Arrays.stream((double[]) o).boxed());
        else if (o instanceof boolean[]) {
            for (boolean b : (boolean[]) o) add(b, " ");
            add("\n");
        } else
            add(o, "\n");
    }

    void printf(int[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(long[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(double[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(boolean[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(Collection<?> col) {
        printf(col.stream());
    }

    <T, K> void add(T t, K k) {
        if (t instanceof Collection<?>) {
            ((Collection<?>) t).forEach(i -> add(i, " "));
        } else if (t instanceof Object[]) {
            Arrays.stream((Object[]) t).forEach(i -> add(i, " "));
        } else
            add(t);
        add(k);
    }

    <T> void add(T t) {
        answer.append(t);
    }

    @SuppressWarnings("unchecked")
    <T extends Comparable<? super T>> T min(T... t) {
        if (t.length == 0)
            return null;
        T m = t[0];
        for (int i = 1; i < t.length; i++)
            if (t[i].compareTo(m) < 0)
                m = t[i];
        return m;
    }

    @SuppressWarnings("unchecked")
    <T extends Comparable<? super T>> T max(T... t) {
        if (t.length == 0)
            return null;
        T m = t[0];
        for (int i = 1; i < t.length; i++)
            if (t[i].compareTo(m) > 0)
                m = t[i];
        return m;
    }

    static class Pair<K extends Comparable<? super K>, V extends Comparable<? super V>>
            implements Comparable<Pair<K, V>> {
        private K k;
        private V v;

        Pair(K k, V v) {
            this.k = k;
            this.v = v;
        }

        @SuppressWarnings("unchecked")
        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || !(o instanceof Pair)) return false;
            Pair<K, V> p = (Pair<K, V>) o;
            return k.compareTo(p.k) == 0 && v.compareTo(p.v) == 0;
        }

        @Override
        public int hashCode() {
            int hash = 31;
            hash = hash * 89 + k.hashCode();
            hash = hash * 89 + v.hashCode();
            return hash;
        }

        @Override
        public int compareTo(Pair<K, V> pair) {
            return k.compareTo(pair.k) == 0 ? v.compareTo(pair.v) : k.compareTo(pair.k);
        }

        @Override
        public Pair<K, V> clone() {
            return new Pair<K, V>(this.k, this.v);
        }

        @Override
        public String toString() {
            return String.valueOf(k).concat(" ").concat(String.valueOf(v)).concat("\n");
        }
    }

    static class Reader {
        private BufferedReader br;
        private StringTokenizer st;

        Reader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            try {
                while (st == null || !st.hasMoreTokens()) {
                    st = new StringTokenizer(br.readLine());
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
                arr[i] = nextInt();
            return arr;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Stream;

public class Main implements Runnable {
    static final int MOD = (int) 1e9 + 7;
    static final int MI = (int) 1e9;
    static final long ML = (long) 1e18;
    static final Reader in = new Reader();
    static final PrintWriter out = new PrintWriter(System.out);
    StringBuilder answer = new StringBuilder();

    public static void main(String[] args) {
        new Thread(null, new Main(), "persefone", 1 << 28).start();
    }

    @Override
    public void run() {
        solve();
        printf();
        flush();
    }

    void solve() {
        int n = in.nextInt();
        char[] type = new char[n];
        for (int i = 0; i < n; i++) type[i] = in.next().charAt(0);
        int[][] dp = new int[n][n + 1];
        dp[0][0] = 1;
        for (int i = 1; i < n; i++) {
            if (type[i - 1] == 'f') {
                dp[i][0] = 0;
                for (int j = 1; j <= i; j++) dp[i][j] = (dp[i][j] + dp[i - 1][j - 1]) % MOD;
            } else {
                dp[i][i - 1] = dp[i - 1][i - 1];
                for (int j = i - 2; j > -1; j--) dp[i][j] = (dp[i][j + 1] + dp[i - 1][j]) % MOD;
            }
        }
        int ans = 0;
        for (int i = 0; i < n; i++) ans = (ans + dp[n - 1][i]) % MOD;
        printf(ans);
    }

    void printf() {
        out.print(answer);
    }

    void close() {
        out.close();
    }

    void flush() {
        out.flush();
    }

    void printf(Stream<?> str) {
        str.forEach(o -> add(o, " "));
        add("\n");
    }

    void printf(Object... obj) {
        printf(false, obj);
    }

    void printfWithDescription(Object... obj) {
        printf(true, obj);
    }

    private void printf(boolean b, Object... obj) {

        if (obj.length > 1) {
            for (int i = 0; i < obj.length; i++) {
                if (b) add(obj[i].getClass().getSimpleName(), " - ");
                if (obj[i] instanceof Collection<?>) {
                    printf((Collection<?>) obj[i]);
                } else if (obj[i] instanceof int[][]) {
                    printf((int[][]) obj[i]);
                } else if (obj[i] instanceof long[][]) {
                    printf((long[][]) obj[i]);
                } else if (obj[i] instanceof double[][]) {
                    printf((double[][]) obj[i]);
                } else printf(obj[i]);
            }
            return;
        }

        if (b) add(obj[0].getClass().getSimpleName(), " - ");
        printf(obj[0]);
    }

    void printf(Object o) {
        if (o instanceof int[])
            printf(Arrays.stream((int[]) o).boxed());
        else if (o instanceof char[])
            printf(new String((char[]) o));
        else if (o instanceof long[])
            printf(Arrays.stream((long[]) o).boxed());
        else if (o instanceof double[])
            printf(Arrays.stream((double[]) o).boxed());
        else if (o instanceof boolean[]) {
            for (boolean b : (boolean[]) o) add(b, " ");
            add("\n");
        } else
            add(o, "\n");
    }

    void printf(int[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(long[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(double[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(boolean[]... obj) {
        for (int i = 0; i < obj.length; i++) printf(obj[i]);
    }

    void printf(Collection<?> col) {
        printf(col.stream());
    }

    <T, K> void add(T t, K k) {
        if (t instanceof Collection<?>) {
            ((Collection<?>) t).forEach(i -> add(i, " "));
        } else if (t instanceof Object[]) {
            Arrays.stream((Object[]) t).forEach(i -> add(i, " "));
        } else
            add(t);
        add(k);
    }

    <T> void add(T t) {
        answer.append(t);
    }

    @SuppressWarnings("unchecked")
    <T extends Comparable<? super T>> T min(T... t) {
        if (t.length == 0)
            return null;
        T m = t[0];
        for (int i = 1; i < t.length; i++)
            if (t[i].compareTo(m) < 0)
                m = t[i];
        return m;
    }

    @SuppressWarnings("unchecked")
    <T extends Comparable<? super T>> T max(T... t) {
        if (t.length == 0)
            return null;
        T m = t[0];
        for (int i = 1; i < t.length; i++)
            if (t[i].compareTo(m) > 0)
                m = t[i];
        return m;
    }

    static class Pair<K extends Comparable<? super K>, V extends Comparable<? super V>>
            implements Comparable<Pair<K, V>> {
        private K k;
        private V v;

        Pair(K k, V v) {
            this.k = k;
            this.v = v;
        }

        @SuppressWarnings("unchecked")
        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || !(o instanceof Pair)) return false;
            Pair<K, V> p = (Pair<K, V>) o;
            return k.compareTo(p.k) == 0 && v.compareTo(p.v) == 0;
        }

        @Override
        public int hashCode() {
            int hash = 31;
            hash = hash * 89 + k.hashCode();
            hash = hash * 89 + v.hashCode();
            return hash;
        }

        @Override
        public int compareTo(Pair<K, V> pair) {
            return k.compareTo(pair.k) == 0 ? v.compareTo(pair.v) : k.compareTo(pair.k);
        }

        @Override
        public Pair<K, V> clone() {
            return new Pair<K, V>(this.k, this.v);
        }

        @Override
        public String toString() {
            return String.valueOf(k).concat(" ").concat(String.valueOf(v)).concat("\n");
        }
    }

    static class Reader {
        private BufferedReader br;
        private StringTokenizer st;

        Reader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            try {
                while (st == null || !st.hasMoreTokens()) {
                    st = new StringTokenizer(br.readLine());
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
                arr[i] = nextInt();
            return arr;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }
    }
}


import java.util.Scanner;

public class python {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		int lines = input.nextInt();
		int[][] x = new int[lines+1][lines+1];

		x[0][0] = 1;

		for (int i = 0; i < lines; i++) {
			String line = input.next();

			if (line.equals("f")) {
				x[i+1][0] = 0;
				for (int z = 1; z <= lines; z++) {
					x[i+1][z] = x[i][z-1] % 1000000007;
				}
			}

			if (line.equals("s")) {
				long y = 0;
				for(int z = lines - 1; z >= 0; z--) {
					y += x[i][z] % 1000000007;
					x[i+1][z] += y;
				}
			}
		}

		int n = 0;
		for(int i = 0; i < lines; i++) {
			n += x[lines-1][i] % 1000000007;

		}

		System.out.println(n);
		input.close();
	}
}


import java.util.Scanner;

public class python {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		int lines = input.nextInt();
		int[][] x = new int[lines+1][lines+1];

		x[0][0] = 1;

		for (int i = 0; i < lines; i++) {
			String line = input.next();

			if (line.equals("f")) {
				x[i+1][0] = 0;
				for (int z = 1; z <= lines; z++) {
					x[i+1][z] = x[i][z-1] % 1000000007;
				}
			}

			if (line.equals("s")) {
				int y = 0;
				for(int z = lines - 1; z >= 0; z--) {
					y += x[i][z] % 1000000007;
					x[i+1][z] += y;
				}
			}
		}

		long n = 0;
		for(int i = 0; i < lines; i++) {
			n += x[lines-1][i] % 1000000007;

		}

		System.out.println(n);
		input.close();
	}
}


import java.util.Scanner;

public class python {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		int lines = input.nextInt();
		long[][] x = new long[lines+1][lines+1];

		x[0][0] = 1;

		for (int i = 0; i < lines; i++) {
			String line = input.next();

			if (line.equals("s")) {
				long y = 0;
				for(int z = lines - 1; z >= 0; z--) {
					y += x[i][z];
					y %= 1000000007;
					x[i+1][z] += y;
					x[i+1][z] %= 1000000007;
				}
			}

			if (line.equals("f")) {
				x[i+1][0] = 0;
				for (int z = 1; z <= lines; z++) {
					x[i+1][z] = x[i][z-1] % 1000000007;
				}
			}

		}

		long n = 0;
		for(int i = 0; i < lines; i++) {
			n += x[lines-1][i] % 1000000007;
			n %= 1000000007;

		}

		System.out.println(n);
		input.close();
	}
}


import java.util.Scanner;

public class python {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		int lines = input.nextInt();
		int[][] x = new int[lines+1][lines+1];

		x[0][0] = 1;

		for (int i = 0; i < lines; i++) {
			String line = input.next();

			if (line.equals("f")) {
				x[i+1][0] = 0;
				for (int z = 1; z <= lines; z++) {
					x[i+1][z] = x[i][z-1] % 1000000007;
				}
			}

			if (line.equals("s")) {
				int y = 0;
				for(int z = lines; z > 0; z--) {
					y += x[i][z-1] % 1000000007;
					x[i+1][z-1] = y;
				}
			}
		}

		int n = 0;
		for(int i = 0; i < lines; i++) {
			n += x[lines-1][i];
			n %= 1000000007;
		}

		System.out.println(n);
		input.close();
	}
}


fun main(args: Array<String>) {
    val set = readLine()!!.split(' ').drop(1).map(String::toInt).toMutableSet()

    for (e in readLine()!!.split(' ').drop(1).map(String::toInt)) {
        if (e in set)
            set.remove(e)
        else
            set.add(e)
    }

    print("${set.size} ")
    set.forEach { print("$it ") }
}


fun main(args: Array<String>) {

    val a: List<Int> = readLine()!!.split(' ').map(String::toInt);
    val b: List<Int> = readLine()!!.split(' ').map(String::toInt);

    var flag1: Int = 0;
    for(i in a)
    {
        if(flag1==1)
        {
            var flag2: Int = 0;
            var was: Int = 0;
            for(j in b)
            {
                if(i==j&&flag2==1)
                    was = 1;
                flag2 = 1;
            }
            if(was==0)
                print("$i ");

        }
         flag1 = 1;
    }
    flag1 = 0;
    for(i in b)
    {
        if(flag1==1)
        {
            var flag2: Int = 0;
            var was: Int = 0;
            for(j in a)
            {
                if(i==j&&flag2==1)
                    was = 1;
                flag2 = 1;
            }
            if(was==0)
                print("$i ");

        }
         flag1 = 1;
    }

}


fun main(args: Array<String>) {

    val a: List<Int> = readLine()!!.split(' ').map(String::toInt);
    val b: List<Int> = readLine()!!.split(' ').map(String::toInt);

    var res = Array(2000, {i->0});
    var count = 0;

    var flag1: Int = 0;
    for(i in a)
    {
        if(flag1==1)
        {
            var flag2: Int = 0;
            var was: Int = 0;
            for(j in b)
            {
                if(i==j&&flag2==1)
                    was = 1;
                flag2 = 1;
            }
            if(was==0)
            {
                res[count] = i;
                count++;
            }

        }
         flag1 = 1;
    }
    flag1 = 0;
    for(i in b)
    {
        if(flag1==1)
        {
            var flag2: Int = 0;
            var was: Int = 0;
            for(j in a)
            {
                if(i==j&&flag2==1)
                    was = 1;
                flag2 = 1;
            }
            if(was==0)
            {
                res[count] = i;
                count++;
            }

        }
         flag1 = 1;
    }
    print(count);
    for(i in 0..count-1)
    {
        print(' ');
        print(res[i]);
    }

}


fun main(args: Array<String>) {
    var a=readLine()!!.split(' ').map(String::toInt);
    var b=readLine()!!.split(' ').map(String::toInt);
    val fa = Array(2500,{ i -> 0 });
    val fb = Array(2500,{ i -> 0 });

    for(i in 1..a.lastIndex)fa[a[i]+1000]=1;
    for(i in 1..b.lastIndex)fb[b[i]+1000]=1;

    val ans=arrayListOf<Int>();
    for(i in 1..2000){
    	if(fa[i]+fb[i]==1){
            ans.add(i-1000)
        }
    }
    var x=(ans.lastIndex+1).toString();
    for(i in 0..ans.lastIndex)x+=" "+ans[i].toString();
    println(x)

}


fun main(args: Array<String>) {
    var a=readLine()!!.split(' ').map(String::toInt);
    var b=readLine()!!.split(' ').map(String::toInt);
    val fa = Array(2500,{ i -> 0 });
    val fb = Array(2500,{ i -> 0 });

    for(i in 1..a.lastIndex)fa[a[i]+1000]=1;
    for(i in 1..b.lastIndex)fb[b[i]+1000]=1;

    val ans=arrayListOf<Int>();
    for(i in 0..2000){
    	if(fa[i]+fb[i]==1){
            ans.add(i-1000)
        }
    }
    var x=(ans.lastIndex+1).toString();
    for(i in 0..ans.lastIndex)x+=" "+ans[i].toString();
    println(x)

}


fun main(args: Array<String>) {
    var f1 = readLine()!!.split(' ').map(String::toInt)
    var f2 = readLine()!!.split(' ').map(String::toInt)
    var f3 = Array(3000,{0})
    var k=0
    for((i1,v1) in f1.withIndex()){
        if(i1!=0){
            var u=false
            for((i2,v2) in f2.withIndex()){
                if(i2!=0 && v2==v1) u=true
            }
            if(u==false){
                f3[k]=v1
                k+=1
            }
        }
    }
    for((i1,v1) in f2.withIndex()){
        if(i1!=0){
            var u=false
            for((i2,v2) in f1.withIndex()){
                if(i2!=0 && v2==v1) u=true
            }
            if(u==false){
                f3[k]=v1
                k+=1
            }
        }
    }
    print(k)
    print(' ')
    for((i,v) in f3.withIndex()){
        if(i<k){
            print(v)
            print(' ')
        }
    }
}


fun main(args: Array<String>) {
    var f1 = readLine()!!.split(' ').map(String::toInt)
    var f2 = readLine()!!.split(' ').map(String::toInt)
    var f3 = Array(1000,{0})
    var k=0
    for((i1,v1) in f1.withIndex()){
        if(i1!=0){
            var u=false
            for((i2,v2) in f2.withIndex()){
                if(i2!=0 && v2==v1) u=true
            }
            if(u==false){
                f3[k]=v1
                k+=1
            }
        }
    }
    for((i1,v1) in f2.withIndex()){
        if(i1!=0){
            var u=false
            for((i2,v2) in f1.withIndex()){
                if(i2!=0 && v2==v1) u=true
            }
            if(u==false){
                f3[k]=v1
                k+=1
            }
        }
    }
    print(k)
    print(' ')
    for((i,v) in f3.withIndex()){
        if(i<k){
            print(v)
            print(' ')
        }
    }
}


fun main(args: Array<String>) {
    val x = readLine()!!.split(' ').map(String::toInt)
    val y = readLine()!!.split(' ').map(String::toInt)
    val a = arrayListOf<Int>()
    val b = arrayListOf<Int>()
    for (i in 1..x[0]) a.add(x[i])
    for (i in 1..y[0]) b.add(y[i])
    var cnt = 0
    for (i in a) {
        if (i !in b) cnt++
    }
    for (i in b) {
        if (i !in a) cnt++
    }
    print(cnt)
    for (i in a) {
        if (i !in b) {
            print(" ")
            print(i)
        }
    }
    for (i in b) {
        if (i !in a) {
            print(" ")
            print(i)
        }
    }
}


fun main(args: Array<String>) {
    val a = readLine()!!.split(' ').map(String::toInt)
    val b = readLine()!!.split(' ').map(String::toInt)
    var cnt = 0
    for (i in 1..a[0]) {
        if (a[i] !in b) cnt++;
    }
    for (i in 1..b[0]) {
        if (b[i] !in a) cnt++;
    }
    print(cnt)
    for (i in 1..a[0]) {
        if (a[i] !in b) {
            print(" ")
            print(a[i])
        }
    }
    for (i in 1..b[0]) {
        if (b[i] !in a) {
            print(" ")
            print(b[i])
        }
    }
}


fun main(args: Array<String>) {
    var a = readLine()!!.split(' ').map(String::toInt)
    var b = readLine()!!.split(' ').map(String::toInt)
    a[0] = -1
    b[0] = -1
    var cnt = 0
    for (i in a) {
        if (i !in b) cnt++;
    }
    for (i in b) {
        if (i !in a) cnt++;
    }
    print(cnt)
    for (i in a) {
        if (i !in b) {
            print(" ")
            print(i)
        }
    }
    for (i in b) {
        if (i !in a) {
            print(" ")
            print(i)
        }
    }
}


fun main(args: Array<String>) {
    val a = readLine()!!.split(' ').map(String::toInt)
    val b = readLine()!!.split(' ').map(String::toInt)
    var cnt = 0
    for (i in 1..a[0]) {
        if (a[i] !in b || a[i] == b[0]) cnt++;
    }
    for (i in 1..b[0]) {
        if (b[i] !in a || b[i] == a[0]) cnt++;
    }
    print(cnt)
    for (i in 1..a[0]) {
        if (a[i] !in b || a[i] == b[0]) {
            print(" ")
            print(a[i])
        }
    }
    for (i in 1..b[0]) {
        if (b[i] !in a || b[i] == a[0]) {
            print(" ")
            print(b[i])
        }
    }
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val n = args[1].toInt()
    val arr = readLine()!!.split(' ').map(String::toInt)
    println("${n}")
    println("${arr}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	//val m = args[n + 1].toInt()
	//val vals2 = readLine()!!.split(' ').map(String::toInt)
	//println("Hello, ${n}!")
	//println("Hello, ${m}!")

	/*println("${vals1.size} ")
    for (i in vals1)
    {
		print("${vals1[i]} ")
    }*/

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    //val n = args[0].toInt()
    val n = readLine()!!.split(' ').map(String::toInt)
    println("${n}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	//val m = args[n + 1].toInt()
	//val vals2 = readLine()!!.split(' ').map(String::toInt)
	//println("Hello, ${n}!")
	//println("Hello, ${m}!")

	/*println("${vals1.size} ")
    for (i in vals1)
    {
		print("${vals1[i]} ")
    }*/

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val vals1 = readLine()!!.split(' ').map(String::toInt)
    val n = vals1[0]
    //println("${n}")
   ///println("${vals1}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	val vals2 = readLine()!!.split(' ').map(String::toInt)
 	val m = vals2[0]
    //println("${m}")
   ///println("${vals2}")
    //vals1.set(0, 555)
    //vals1[0]

	//println("Hello, ${n}!")
	//println("Hello, ${m}!")
	//
	/*var i = 0
    while (i < args.size)
        println(args[i++]) */

   	var x = 0

	//println("${vals1.size} ")
    for (i in vals1)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("${vals1[i]}, ")
    }

    /*x = 1

	for (j in vals2)
    {
        if (x === 1)
        {
            x = 0
            continue
        }
		print("i: ${j} -> ${vals1[j]}, ")
    */
	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    val n = args[0].toInt()
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	val vals1 = readLine()!!.split(' ').map(String::toInt)
	val m = args[n + 1].toInt()
	val vals2 = readLine()!!.split(' ').map(String::toInt)
	println("Hello, ${n}!")
	println("Hello, ${m}!")

	/*println("${vals1.size} ")
    for (i in vals1)
    {
		print("${vals1[i]} ")
    }*/

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}


fun main(args: Array<String>) {
    //val (n) = readLine()!!.split(' ').map(String::toInt)

    //println(1);
    val n = args[0].toInt()
    val arr = readLine()!!.split(' ').map(String::toInt)
    println("${n}")
    println("${arr}")
	//val vals1 = Array(n, { i -> (i * i).toInt() })
	//val vals1 = Array(n, readLine()!!.split(' ').map(String::toInt))
	//val vals1 = readLine()!!.split(' ').map(String::toInt)
	//val m = args[n + 1].toInt()
	//val vals2 = readLine()!!.split(' ').map(String::toInt)
	//println("Hello, ${n}!")
	//println("Hello, ${m}!")

	/*println("${vals1.size} ")
    for (i in vals1)
    {
		print("${vals1[i]} ")
    }*/

	/*for (i in vals1)
    {

        for (j in vals2)
        {
            if (vals1[i] == vals2[j])
            {
                print("${vals1[i]} ")
            }
        }
    }*/
}