#include<bits/stdc++.h>
#include<stdio.h>
#define int long long
#define pb push_back
#define fo(i,a,n) for(int i=a;i<n;i++)
#define foo(i,a,n) for(int i=a;i>=n;i--)
#define sn s.length()
#define get(n) cin>>n
#define put(n) cout<<n
//getline(cin >> ws, x);   eats whitespace
// round()  nearest int after round
using namespace std;
 
signed main()
{
    int t=1;
   // cin>>t;
    while(t--)
    {
        int n,x;
        cin>>n;
        string s;
        cin>>s;
        vector<char>c;
        fo(i,0,n)
        {
            if(s[i]=='x'&&c.size()>1)
            {
                x=c.size();
                char cc=c[x-1];
                c.pop_back();
                x=c.size()-1;
                if(c[x]=='f'&&cc=='o')
                c.pop_back();
                else
                {
                    c.push_back(cc);
                    c.pb(s[i]);
                }
            }
            else
            c.pb(s[i]);
        }
        cout<<c.size();
    }
}
#include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, n) for (int i = a; i < (int)n; i++)
#define REP(i, n) FOR(i, 0, n)

int  H, W;
char S[10][10];
int dh[8]{ -1, -1,  0,  1,  1,  1,  0, -1 };
int dw[8]{  0,  1,  1,  1,  0, -1, -1, -1 };

bool check(int h, int w, int d, char c) {
  return S[h+dh[d%8]][w+dw[d%8]] == c;
}

int main() {
  cin >> H >> W;
  REP(i, H) REP(j, W) cin >> S[i][j];

  int ans = 0;
  REP(i, H) REP(j, W) if (S[i][j] == '#') {
    for (int k = 0; k < 8; k += 2) {
       ans += (check(i, j, k, '.') && check(i, j, k+2, '.'));
       ans += (check(i, j, k, '#') && check(i, j, k+1, '.') && check(i, j, k+2, '#'));
    }
  }
  cout << ans << endl;

  return 0;
}