#include <assert.h>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <set>
#include <map>
#define F first
#define S second
#define dq deque
#define vc vector
#define INF ((int)(1e9))
#define LINF ((int)(1e18))
#define out cout <<
#define ln  << endl
#define pb push_back
#define mp make_pair
#define _tp template
#define _tyn typename
#define pf push_front
#define itor iterator
#define mp make_pair
#define sint short int
#define ull unsigned long long
#define pii pair<int,int>
#define uint unsigned int
#define ll long long
#define B out "BreakPoint\n";
#define read(_nowans) scanf("%d",&_nowans)
#define ms(_data) memset(_data,0,sizeof(_data))
#define fin(_filename) freopen(_filename,"r",stdin)
#define fout(_filename) freopen(_filename,"w",stdout)
#define read2(_nowans1,_nowans2) scanf("%d %d",&_nowans1,&_nowans2)
#define msn(_data,_nowans) memset(_data,_nowans,sizeof(_data))
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
#define read3(_nowans1,_nowans2,_nowans3) scanf("%d %d %d",&_nowans1,&_nowans2,&_nowans3)
#define lb( _x , _y ) ( lower_bound( _x.begin() , _x.end() , _y ) - _x.begin() + 1 )
using namespace std;
_tp<_tyn T>void mymax( T &_a , T _b ){ if( _a < _b ) _a = _b; }
_tp<_tyn T>void mymin( T &_a , T _b ){ if( _a > _b ) _a = _b; }
void print( int _x ){ printf("%d\n",_x); }
_tp<_tyn T>void print( T _data[] , int _size ){
	for( int i = 1 ; i <= _size ; i++ )
		cout << _data[i] << " ";
	cout << endl;
}
#define MAXN 210
#define MASK 260

int n,m,r;
bool isim[MAXN];
int imid[MAXN];
int idim[MAXN];

struct Event{
	int pos,dis,been;
	Event(){}
	Event( int poss , int diss , int ben ){
		pos = poss;
		dis = diss;
		been = ben;
	}
};
bool operator<( Event e1 , Event e2 ){
	if( e1.dis != e2.dis ) return e1.dis > e2.dis;
	return __builtin_popcount(e1.been) > __builtin_popcount(e2.been);
}
priority_queue<Event> pq;
int mincost[MAXN][MASK];

#define FULL ( ( 1 << r ) - 1 )
bool getwei( int x , int wei ){
	return x & ( 1 << ( wei-1 ) );
}
int addmask( int x , int wei ){
	return x | ( 1 << ( wei-1 ) );
}

int dist[MAXN][MAXN];
int bp( int stpos ){
	for( int i = 1 ; i <= n ; i++ )
		for( int j = 0 ; j <= FULL ; j++ )
			mincost[i][j] = INF;
	while( !pq.empty() ) pq.pop();
	int ret = INF;

	pq.push( Event( stpos , 0 , addmask(0,stpos) ) );
	while( !pq.empty() ){
		Event now = pq.top();
		pq.pop();
		if( now.dis > mincost[now.pos][now.been] ) continue;
		if( now.been == FULL )
			mymin( ret , now.dis );
			//return now.dis;
		for( int i = 1 ; i <= r ; i++ ){
			int u = idim[now.pos];
			int v = idim[i];
			int dis = dist[u][v];
			if( getwei( now.been , i ) ) continue;
			int newbeen = addmask( now.been , i );
			if( now.dis + dis > mincost[i][newbeen] ) continue;
			mincost[i][newbeen] = now.dis + dis;
			pq.push( Event( i , now.dis + dis , newbeen ) );
		}
	}
	return ret;
}
void floyd(){
	for( int k = 1 ; k <= n ; k++ )
		for( int i = 1 ; i <= n ; i++ )
			for( int j = 1 ; j <= n ; j++ )
				mymin( dist[i][j] , dist[i][k] + dist[k][j] );
}

int main(){
	//fin( "D.txt" );
	ms( isim );

	scanf("%d %d %d",&n,&m,&r);
	for( int i = 1 ; i <= r ; i++ ){
		int x;
		scanf("%d",&x);
		isim[x] = 1;
		imid[x] = i;
		idim[i] = x;
	}

	for( int i = 0 ; i <= n ; i++ )
		for( int j = 0 ; j <= n ; j++ ){
			if( i != j )
				dist[i][j] = INF;
			else
				dist[i][j] = 0;
		}
	for( int i = 1 ; i <= m ; i++ ){
		int a,b,c;
		scanf("%d %d %d",&a,&b,&c);
		dist[a][b] = dist[b][a] = c;
	}

	floyd();

	//for( int i = 1 ; i <= n ; i++ ){
	//	print( dist[i] , n );
	//}

	int ans = INF;
	for( int i = 1 ; i <= r ; i++ ){
		//cout << "St: " << idim[i] << "  Ans: " << bp(i) << endl;
		mymin( ans , bp(i) );
	}

	printf("%d\n",ans);

	return 0;
}


Measured memory_bytes: 768