#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<ii>
#define vc vector<char>
#define vs vector<string>
#define vd vector<double>
#define vll vector<ll>
#define vvi vector<vi>
#define vvii vector<vii>
#define vvc vector<vc>
#define vvs vector<vs>
#define vvll vector<vll>
#define vvd vector<vd>
#define FOR(x,n) for(int x=0;x<n;x++)
#define FORS(x,n) for(int x=1;x<=n;x++)
#define FORE(x,a) for(auto &x: a)
#define ALL(x) x.begin(),x.end()
#define REP(n) for(int _ = 0; _ < n; _++)
#define MT make_tuple
#define pb push_back
#define endl '\n'
#define F first
#define S second

vvi con;
vi vis;

void dfs(int u) {
  if(vis[u]) return;
  vis[u] = 1;
  for(auto x: con[u]) dfs(x);
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int h,w;
  cin >> h >> w;
  vs b(h);
  FOR(i,h) cin >> b[i];
  con.resize(h+w);
  vis.resize(h+w);
  FOR(i,h) {
    FOR(j,w) {
      if(b[i][j] == '#') {
        con[i].pb(h+j);
        con[h+j].pb(i);
      }
    }
  }

  int t = 0;
  int th=0,tw=0;
  con[0].pb(h);
  con[0].pb(h-1);
  con[0].pb(h+w-1);
  con[h].pb(0);
  con[h-1].pb(0);
  con[h+w-1].pb(0);
  dfs(0);
  FOR(i,h) {
    if(con[i].size() && !vis[i]) {
      dfs(i);t++;
    } else if(con[i].empty()) {
      th++;
    }
  }
  FOR(i,w) {
    if(con[h+i].size() && !vis[h+i]) {
      dfs(h+i);t++;
    } else if(con[h+i].empty()) {
      tw++;
    }
  }
  //cerr << t << " " << th << " " << tw << endl;
  cout << t + min(th,tw) << endl;
}

#include <bits/stdc++.h>
#define f first
#define s second
#define fore(i,a,b) for(int i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define all(s) begin(s), end(s)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sz(s) int(s.size())
#define ENDL '\n'
#define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
using namespace std;
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
typedef long long lli;
typedef pair<int,int> ii;
typedef vector<int> vi;
#define deb(x) cout << #x": " << (x) << endl;

lli gcd(lli a, lli b){return (b?gcd(b,a%b):a);}
lli lcm(lli a, lli b){ if(!a || !b) return 0; return a * b / gcd(a, b); }
int popcount(lli x) { return __builtin_popcountll(x); }

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// int rnd(int n){return uniform_int_distribution<int>(0, n-1)(rng);}

lli poww(lli a, lli b){
	lli res =1;
	while(b){ if(b&1) res = res * a; a = a*a; b/=2; }
	return res;
}

vvc<int> graph(int n, int m, bool dir=1){
	vv(int,v,n+1,0);
	fore(i,0,m){
		int a,b; cin>>a>>b;
		v[a].pb(b);
		if(dir)v[b].pb(a);
	}
	return v;
}
template <typename T> static constexpr T inf = numeric_limits<T>::max() / 2;
// ---- コーディングはここから！ ('-')7


void solve(){
	using t = array<long double,2>;
	int n,m; cin>>n>>m;
	int k; cin>>k;
	vi v(n+1,0); fore(i,0,k){int a; cin>>a; v[a]=1;}
	fore(i,0,n){
		if(v[i]==0)continue;
		int j = i;
		while(j<=n and v[j])j++;
		if(j-i>=m){cout<<-1<<ENDL;return;}
		i = j-1;
	}
	vc<t>dp(n+m);
	t sum = {0,0};
	for(int i = n+m-1;i>=0;i--){
		if(i>=n)dp[i]={0,0};
		else if(v[i])dp[i]={1,0};
		else dp[i]={sum[0]/(1.0*m),sum[1]/(1.*m)+1};
		sum[0]+=dp[i][0];
		sum[1]+=dp[i][1];
		if(i+m<n+m)sum[0]-=dp[i+m][0],sum[1]-=dp[i+m][1];
	}
	long double ans = dp[0][1]/(1.0-dp[0][0]);

	cout<<fixed<<setprecision(7)<<ans<<ENDL;

}

int main(){_
	//int t; cin>>t; while(t--)
	solve();
}
