#include <iostream>
#include <math.h>
using namespace std;

typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define memset(v, h) memset((v), h, sizeof(v))
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
    ll n, k, m;
    cin >> n >> k >> m;
    ll a[n];
    ll p = 0;
    rep(i,n-1){
        cin >> a[i];
        p+=a[i];
    }
    ll x = m * n;
    ll g = x - p;
    if(g < 0)
    {
        cout << 0 << endl;
    }
    else if(g > k)
    {
        cout << -1 << endl;
    }
    else
    {
        cout << g << endl;
    }

    return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+5;
typedef long double ld;
int n,m;
ll k;
string s,t;
int c[10];
int p[6]={1,10,100,1000,10000,100000};
inline bool calc(int x,int y){
	int i,j;
	for(i=0;i<4;i++) c[s[i]-'0']++;
	c[x]++;
	int a1=0,a2=0;
	for(i=1;i<=9;i++) a1+=i*p[c[i]];
	for(i=1;i<=9;i++) c[i]=0;
	for(i=0;i<4;i++) c[t[i]-'0']++;
	c[y]++;
	for(i=1;i<=9;i++) a2+=i*p[c[i]];
///	cout<<x<<" "<<y<<" "<<a1<<" "<<a2<<endl;
	for(i=1;i<=9;i++) c[i]=0;
	return (a1>a2);
}
int f[10];
int main(){
	int i,j;
	cin>>k>>s>>t;
	for(i=1;i<=9;i++) f[i]=k;
	for(i=0;i<4;i++){
		f[s[i]-'0']--;
		f[t[i]-'0']--;
	}
	ll sum=(9*k-8)*(9*k-9);
	ld ans=0;
	for(i=1;i<=9;i++){
		for(j=1;j<=9;j++){
			if(!f[i]||!f[j]) continue;
			if(i==j){
				if(f[i]<2) continue;
				if(calc(i,j))
					ans+=ld(f[i])*(f[i]-1)/sum;
			}
			else{
				if(calc(i,j))
					ans+=ld(f[i])*f[j]/sum;
			}
		}
	}
	printf("%.12Lf",ans);
	return 0;
}