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

bool is_sorted(const vector<int>& vec){
	int n = vec.size();
	for(int i = 0; i + 1 < n; i ++){
		if(vec[i] >= vec[i + 1]) return false;
	}
	return true;
}

int main(int argc, char** argv){
	ifstream input_file(argv[1]);
	ifstream contestant_file(argv[3]);
	
	if(!input_file){
		cerr << "Input file " << argv[1] << " not found." << endl;
		cout << 0 << endl;
		return 0;
	}
	if(!contestant_file){
		cerr << "Contestant file " << argv[3] << " not found." << endl;
		cout << 0 << endl;
		return 0;
	}
	
	int N;
	double G;
	string input;
	{ // read input file
		input_file >> N >> G;
		input_file >> input;
	}
	
	int L;
	array<vector<int>, 2> contestant; 
	{ // read contestant's answers 
		contestant_file >> L;
		contestant[0] = contestant[1] = vector<int>(L);
		for(auto &x : contestant[0]){
			contestant_file >> x;
		}
		for(auto &x : contestant[1]){
			contestant_file >> x;
		}
	}
	
	if(!is_sorted(contestant[0]) || !is_sorted(contestant[1])){
		cerr << "Wrong answer" << endl;
		cout << 0 << endl;
		return 0;
	}
	
	for(int i = 0; i < L; i ++){
		if(input[contestant[0][i]] != input[contestant[1][i]]){
			cerr << "Wrong answer" << endl;
			cout << 0 << endl;
			return 0;
		}
	}

	double C = 2.0 * L / N;
	double score = min(1.0, max(0.0, C / G)) * 100.0;
	score = min(1.0, score);
	score = max(0.0, score);
	
	cerr << "Accepted with L = " << L << endl;
	cout << score << endl;
	return 0;
}
