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 <cmath>
#include <algorithm>
using namespace std;

#define N 110000
#define INF 1000000000

int n, m, i, x, y, z, len, limit, Time, ans1, ans2, p1[N], p2[N], to[N], ma[N * 4], delta[N * 4], lc[N * 4], fa[N][20], L[N], R[N], depth[N], l[N], till[N], next[N * 2], go[N * 2], f[N * 2];
bool have[N], uu[N];

void read(int &x) {
	char k;
	for (k = getchar(); k <= 32; k = getchar());
	for (x = 0; '0' <= k; k = getchar())	x = x * 10 + k - '0';
}

void add(int x, int y, int z) {
	next[++len] = till[x];
	till[x] = len;
	go[len] = y;
	f[len] = z;
}

void dfs1(int k, int ff) {
	depth[k] = depth[ff] + 1;
	fa[k][0] = ff;
	for (int i = 1; i <= limit; i++)	fa[k][i] = fa[fa[k][i - 1]][i - 1];
	L[k] = ++Time;
	to[Time] = k;
	for (int i = till[k]; i; i = next[i])
		if (go[i] != ff)	l[go[i]] = l[k] + f[i], dfs1(go[i], k);
	R[k] = Time;
}

int lca(int x, int y) {
	if (depth[x] < depth[y])	swap(x, y);
	for (int i = limit; i >= 0; i--)
		if (depth[fa[x][i]] >= depth[y])	x = fa[x][i];
	if (x == y)	return x;
	for (int i = limit; i >= 0; i--)
		if (fa[x][i] != fa[y][i])	x = fa[x][i], y = fa[y][i];
	return fa[x][0];
}

int belong(int x) {
	if (uu[x])	return x;
	for (int i = limit; i >= 0; i--)
		if (!uu[fa[x][i]])	x = fa[x][i];
	return fa[x][0];
}

int nowlca(int x, int y) {
	int a = belong(x), b = belong(y);
	if (a == b)	return lca(x, y);
	else	return (depth[a] > delta[b] ? a : b);
}

void update(int k) {
	if (ma[k * 2] + delta[k * 2] > ma[k * 2 + 1] + delta[k * 2 + 1])	ma[k] = ma[k * 2] + delta[k * 2], lc[k] = lc[k * 2];
	else	if (ma[k * 2] + delta[k * 2] < ma[k * 2 + 1] + delta[k * 2 + 1])	ma[k] = ma[k * 2 + 1] + delta[2 * k + 1], lc[k] = lc[k * 2 + 1];
	else	ma[k] = ma[k * 2] + delta[k * 2], lc[k] = nowlca(lc[k * 2], lc[k * 2 + 1]);
}

void mkt(int k, int q, int h) {
	if (q < h) {
		mkt(k * 2, q, (q + h) / 2);
		mkt(k * 2 + 1, (q + h) / 2 + 1, h);
		update(k);
	}else {
		if (!have[to[q]])	ma[k] = -INF;
		else	ma[k] = l[to[q]];
		lc[k] = to[q];
	}
}

void downdate(int k) {
	ma[k] += delta[k];
	delta[k * 2] += delta[k];
	delta[k * 2 + 1] += delta[k];
	delta[k] = 0;
}

void modify(int k, int q, int h, int l, int r, int x) {
	if (l <= q && h <= r)	delta[k] += x;
	else {
		downdate(k);
		if (r <= (q + h) / 2)	modify(k * 2, q, (q + h) / 2, l, r, x);
		else	if ((q + h) / 2 < l)	modify(k * 2 + 1, (q + h) / 2 + 1, h, l, r, x);
		else	modify(k * 2, q, (q + h) / 2, l, r, x), modify(k * 2 + 1, (q + h) / 2 + 1, h, l, r, x);
		update(k);
	}
}

void dfs2(int k, int ff, int p) {
	uu[k] = true;
	if (k == 1)	mkt(1, 1, n);
	else {
		modify(1, 1, n, L[k], R[k], -p);
		modify(1, 1, n, 1, L[k] - 1, p);
		if (R[k] < n)	modify(1, 1, n, R[k] + 1, n, p);
	}
	if (have[k]) {
		int x = lca(k, lc[1]);
		p1[x]++;
		p2[k]++;
		p2[lc[1]]++;
	}

	for (int i = till[k]; i; i = next[i])
		if (go[i] != ff)	dfs2(go[i], k, f[i]);

	uu[k] = false;
	if (k != 1) {
		modify(1, 1, n, L[k], R[k], p);
		modify(1, 1, n, 1, L[k] - 1, -p);
		if (R[k] < n)	modify(1, 1, n, R[k] + 1, n, -p);
	}
}

void dfs3(int k, int ff, int now) {
	now += p1[k];
	if (!have[k]) {
		if (now > ans1)	ans1 = now, ans2 = 1;
		else	if (now == ans1)	ans2++;
	}
	for (int i = till[k]; i; i = next[i])
		if (go[i] != ff)	dfs3(go[i], k, now + p2[k]);
}

int main() {
	read(n); read(m);
	for (i = 1; i <= m; i++) {
		read(x);
		have[x] = true;
	}
	for (i = 1; i < n; i++) {
		read(x); read(y); read(z);
		add(x, y, z);
		add(y, x, z);
	}
	limit = int(log(n) / log(2));
	dfs1(1, 0);
	uu[0] = true;
	dfs2(1, 0, 0);
	ans1 = ans2 = 0;
	dfs3(1, 0, 0);
	printf("%d %d\n", ans1, ans2);
}
