7 3
1 4 7
1 2 2
2 3 3
3 4 8
2 5 1
1 6 4
6 7 5
 10 2
1 5
5 3 2
8 4 8
7 6 9
7 10 1
10 1 4
9 5 1
5 8 2
7 2 9
6 5 6
 10 5
4 8 7 5 1
5 1 1
2 7 1
4 3 1
10 9 1
10 1 1
1 8 1
10 7 1
10 3 1
7 6 1
 10 9
9 7 6 10 3 5 2 8 1
9 4 10
10 8 3
3 6 2
5 1 8
5 2 5
1 10 10
6 7 1
9 1 7
1 6 3
 10 5
8 5 2 10 1
3 1 7
5 4 6
10 8 4
6 8 9
7 8 4
9 5 6
8 1 9
2 10 2
9 8 7

3 2
 2 3
 5 1
 0 1
 5 1

#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <queue>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

#define SIZE(x) (int((x).size()))
#define rep(i,l,r) for (int i=(l); i<=(r); i++)
#define repd(i,r,l) for (int i=(r); i>=(l); i--)
#define rept(i,c) for (typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)

#ifndef ONLINE_JUDGE
#define debug(x) { cerr<<#x<<" = "<<(x)<<endl; }
#else
#define debug(x) {}
#endif

#define maxn 100010
#define INF 1000000000

vector< pair<int,int> > e[maxn];
int exist[maxn], maxdep[maxn], maxdepi[maxn], secdep[maxn], secdepi[maxn], updep[maxn], parent[maxn];
int maxfar[maxn], maxfari[maxn], secfar[maxn], secfari[maxn], trifar[maxn], trifari[maxn];
int upcnt[maxn], downcnt[maxn], cnt[maxn];
map<int,int> next[maxn];

void dfs(int cur, int pre)
{
	maxdep[cur]=secdep[cur]=-INF;
	if (exist[cur]) maxdep[cur]=secdep[cur]=0;
	rept(it,e[cur])
		if (it->first!=pre)
		{
			dfs(it->first,cur);
			if (maxdep[it->first]+it->second>maxdep[cur])
			{
				secdep[cur]=maxdep[cur]; secdepi[cur]=maxdepi[cur];
				maxdep[cur]=maxdep[it->first]+it->second; maxdepi[cur]=it->first;
			}
			else  if (maxdep[it->first]+it->second>secdep[cur])
			{
				secdep[cur]=maxdep[it->first]+it->second; secdepi[cur]=it->first;
			}
		}
}

void dfs2(int cur, int pre, int len)
{
	updep[cur]=len;
	rept(it,e[cur])
		if (it->first!=pre)
		{
			int u; if (it->first==maxdepi[cur]) u=secdep[cur]; else u=maxdep[cur]; 
			dfs2(it->first,cur,max(len,u)+it->second);
		}
}

void dfs3(int cur, int pre)
{
	maxfar[cur]=secfar[cur]=trifar[cur]=-INF;
	maxfar[cur]=updep[cur]; maxfari[cur]=pre;
	rept(it,e[cur])
		if (it->first!=pre)
		{
			int u=maxdep[it->first]+it->second;
			if (u>maxfar[cur])
			{
				trifar[cur]=secfar[cur]; trifari[cur]=secfari[cur];
				secfar[cur]=maxfar[cur]; secfari[cur]=maxfari[cur];
				maxfar[cur]=u; maxfari[cur]=it->first;
			}
			else  if (u>secfar[cur])
			{
				trifar[cur]=secfar[cur]; trifari[cur]=secfari[cur];
				secfar[cur]=u; secfari[cur]=it->first;
			}
			else  if (u>trifar[cur]) 
			{
				trifar[cur]=u; trifari[cur]=it->first;
			}
		}
	
	rept(it,e[cur])
		if (it->first!=pre)
			dfs3(it->first,cur);
}

int get(int s, int t)
{
	int t1,k1,t2;
	if (t==maxfari[s])
	{
		t1=secfar[s]; k1=secfari[s]; t2=trifar[s];
	}
	else  if (t==secfari[s])
	{
		t1=maxfar[s]; k1=maxfari[s]; t2=trifar[s];
	}
	else
	{
		t1=maxfar[s]; k1=maxfari[s]; t2=secfar[s];
	}
	if (t1==t2) return -1;
	return k1;
}

void dfs4(int cur, int pre)
{
	parent[cur]=pre;
	if (pre!=-1) next[cur][pre]=get(cur,pre);
	next[cur][cur]=get(cur,cur);
	rept(it,e[cur])
		if (it->first!=pre)
			next[cur][it->first]=get(cur,it->first);
	
	rept(it,e[cur])
		if (it->first!=pre)
			dfs4(it->first,cur);
}

void dfs5(int cur, int pre)
{
	rept(it,e[cur])
		if (it->first!=pre)
			dfs5(it->first,cur);
	
	if (exist[cur] && next[cur][cur]!=-1)
		if (next[cur][cur]==parent[cur]) 
			upcnt[cur]++;
		else  
		{
			downcnt[next[cur][cur]]++;
			cnt[cur]++;
		}
		
	rept(it,e[cur])
		if (it->first!=pre)
		{
			int u=next[cur][it->first];
			if (u==-1) continue;
			if (u==parent[cur]) 
				upcnt[cur]+=upcnt[it->first];
			else  
			{
				downcnt[u]+=upcnt[it->first];
				cnt[cur]+=upcnt[it->first];
			}
		}
}

void dfs6(int cur, int pre)
{
	rept(it,e[cur])
		if (it->first!=pre)
		{
			int u=next[cur][parent[cur]];
			if (u==-1) continue;
			downcnt[u]+=downcnt[cur];
		}
	
	rept(it,e[cur])
		if (it->first!=pre)
			dfs6(it->first,cur);
}

void lemon()
{
	int n,m; scanf("%d%d",&n,&m);
	memset(exist,0,sizeof exist);
	rep(i,1,m)
	{
		int x; scanf("%d",&x);
		exist[x]=1;
	}
	rep(i,1,n-1)
	{
		int x,y,z; scanf("%d%d%d",&x,&y,&z);
		e[x].push_back(make_pair(y,z)); e[y].push_back(make_pair(x,z));
	}
	
	dfs(1,-1);
	if (exist[1]) dfs2(1,-1,0); else dfs2(1,-1,-INF);
	dfs3(1,-1);
	dfs4(1,-1);
	dfs5(1,-1);
	dfs6(1,-1);
	rep(i,1,n) cnt[i]+=upcnt[i]+downcnt[i];
	
	int final=0;
	rep(i,1,n) if (!exist[i]) final=max(final,cnt[i]);
	
	int ways=0;
	rep(i,1,n) if (!exist[i] && cnt[i]==final) ways++;
	printf("%d %d\n",final,ways);
}

int main()
{
	ios::sync_with_stdio(true);
	#ifndef ONLINE_JUDGE
		freopen("348E.in","r",stdin);
	#endif
	lemon();
	return 0;
}

