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<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define Int register int

const int MAXN = 100005;
int n, m, root, num, head[MAXN], nxt[MAXN<<1], to[MAXN<<1], w[MAXN<<1], cnt, S, T;
bool vis[MAXN], flag[MAXN];
inline void insert(int u, int v, int c) { nxt[++cnt] = head[u]; to[cnt] = v; w[cnt] = c; head[u] = cnt; }

int dis[MAXN], fa[MAXN], top[MAXN], dfn[MAXN], idx;
inline void dfs(int u, int anc) {
	dfn[++idx] = u;
	top[u] = anc;
	for(Int v, i = head[u]; i; i= nxt[i]) {
		if((v = to[i]) == fa[u]) continue;
		fa[v] = u;
		dis[v] = dis[u] + w[i];
		dfs(v, anc);
	}
}

int f[MAXN], ans, res;
int main() {
	scanf("%d%d", &n, &m);
	for(Int x, i = 1; i <= m; ++i) {
		scanf("%d", &x);
		vis[x] = true;
	}
	
	for(Int u, v, c, i = n; --i; ) {
		scanf("%d%d%d", &u, &v, &c);
		insert(u, v, c);
		insert(v, u, c);
	}
	
	dis[1] = fa[1] = idx = 0;
	dfs(1, 1); S = 1;
	for(Int i = 1; i <= n; ++i) if(vis[i] && dis[i] > dis[S]) S = i;
	
	dis[S] = fa[S] = idx = 0;
	dfs(S, S); T = 0;
	for(Int i = 1; i <= n; ++i) if(vis[i] && dis[i] > dis[T]) T = i;
	
	for(root = T; dis[root] > dis[T] / 2; root = fa[root]);
	
	dis[root] = fa[root] = idx = 0;
	for(Int i = head[root]; i; i = nxt[i]) {
		fa[to[i]] = root;
		dis[to[i]] = dis[root] + w[i];
		dfs(to[i], to[i]);
	}
	
	for(Int i = 1; i <= n; ++i)
		if(vis[i] && !flag[top[i]] && dis[i] == dis[T]) ++num, flag[top[i]] = true;
	
	for(Int i = 1; i <= n; ++i) {
		if(!vis[i]) continue;
		++f[i];
		if(top[i] != top[S] && top[i] != top[T] && num == 1) ++f[top[T]];
		else if(top[i] == top[S] && num <= 2) ++f[top[T]];
		else if(top[i] == top[T] && num <= 2) ++f[top[S]];
	}
	
	if(vis[root]) ans = m, res = 1;
	for(Int u, i = n; i; --i) {
		u = dfn[i];
		f[fa[u]] += f[u];
		if(!vis[u]) continue;
		if(f[u] > ans) ans = f[u], res = 1;
		else if(f[u] == ans) ++res;
	}
	printf("%d %d\n", ans, res);
	return 0;
}