#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;


int main(){//main_program
  int H,W,X,Y;
  int count = 1;
  cin >> H >> W >> X >> Y;
  vector<vector<char>> data(H, vector<char>(W));
  
  for(int i = 1;i<=H;i++){
    for(int l = 1;l<=W;l++){
      cin >> data.at(i-1).at(l-1);
    }
  }
  
  for(int i = X-2 ;i >= 0 ; i--){
    if( data.at(i).at(Y-1) == '.'){
      count++;
    }else{
      break;
    }
  }
  //
  for(int i = X ;i < H ; i++){
    if( data.at(i).at(Y-1) == '.'){
      count++;
    }else{
      break;
    }
  }
  //
  //
    for(int i = Y-2 ;i >= 0 ; i--){
    if( data.at(X-1).at(i) == '.'){
      count++;
    }else{
      break;
    }
  }
  //
  for(int i = Y ;i < W ; i++){
    if( data.at(X-1).at(i) == '.'){
      count++;
    }else{
      break;
    }
  }
  cout << count << endl;
}

#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 4000000000000000000 //オーバーフローに注意
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 200005

struct Info{
	Info(){

		kei = value = 0;
	}
	Info(double arg_kei,double arg_value){
		kei = arg_kei;
		value = arg_value;
	}
	Info operator+(const struct Info& arg) const{

		return Info(kei+arg.kei,value+arg.value);
	}
	Info operator-(const struct Info& arg) const{

		return Info(kei-arg.kei,value-arg.value);
	}
	Info operator/(int div) const{

		return Info(kei/div,value/div);
	}


	double kei,value;
};


int N,M,K;
bool check[SIZE];
Info info[SIZE];

int main(){

	scanf("%d %d %d",&N,&M,&K);

	for(int i = 0; i <= N; i++){

		check[i] = true;
	}

	int tmp;
	for(int i = 0; i < K; i++){

		scanf("%d",&tmp);
		check[tmp] = false;
	}

	for(int i = 0; i < M; i++){

		info[N+i].kei = 0;
		info[N+i].value = 0;
	}

	Info sum;

	for(int i = N-1; i >= 0; i--){

		if(!check[i]){

			info[i].kei = 1;
			info[i].value = 0;

		}else{

			info[i] = sum/M + Info(0,1);
		}

		sum = sum+info[i];
		sum = sum-info[i+M];
	}

	double a = info[0].kei;
	double b = info[0].value;

	if(1-a < EPS){

		printf("-1\n");
	}else{

		printf("%.12lf\n",b/(1.0-a));
	}

	return 0;
}


