#include<bits/stdc++.h>
#define pu push
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define rrep(i,x) for(int i=1;i<=x;i++)
#define drep(i,n) for(int i = (n)-1; i >= 0; i--)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define BITSC(x,v) (binary_search(x.begin(),x.end(),v)
#define dup(x,y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
int getInt(){int x;scanf("%d",&x);return x;}
template<typename T>istream& operator>>(istream&i,v(T)&v){rep(j,sz(v))i>>v[j];return i;}
const double eps =1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}

int main(){
    int n,m,k;cin>>n>>m;
    vi a(m);
    vi kukan;
    ll ans=0;

    if(m!=0){
        rep(i,m){
            int temp;cin>>temp;
            temp--;
            a[i]=temp;
        }
        sort(rng(a));
        if(a[0]==0)k=n+20;
        else {
            k=a[0];
            kukan.pb(a[0]);
        }
        rep(i,m-1){
            if(a[i+1]-a[i]==1)continue;
            k=min(k,a[i+1]-a[i]-1);
            kukan.pb(a[i+1]-a[i]-1);
        }
        if(n-1-a[m-1]>0){
            k=min(k,n-1-a[m-1]);
            kukan.pb(n-1-a[m-1]);
        }

        rep(i,kukan.size()){
            ans+=dup(kukan[i],k);
        }
    }



    if(k==n+20)ans=0;
    if(m==0)ans=1;
    cout<<ans<<endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ll mod2 = 998244353;
const ld eps = 1e-10;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b){if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b){if(a<b) a=b;}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int h, w, x, y; cin >> h >> w >> x >> y;
  x--; y--;
  vector<string> S(h); rep(i, h) cin >> S[i];
  int ans = 1;
  for(int i=x+1; i<h; i++) {
    if(S[i][y] == '#') break;
    ans++;
  }
  for(int i=x-1; i>=0; i--) {
    if(S[i][y] == '#') break;
    ans++;
  }
  for(int j=y+1; j<w; j++) {
    if(S[x][j] == '#') break;
    ans++;
  }
  for(int j=y-1; j>=0; j--) {
    if(S[x][j] == '#') break;
    ans++;
  }
  cout << ans << endk;
  return 0;
}
