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

//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define mem(a,v) memset((a), (v), sizeof (a))
#define enl printf("\n")
#define case(t) printf("Case #%d: ", (t))
#define ni(n) scanf("%d", &(n))
#define nl(n) scanf("%I64d", &(n))
#define nai(a, n) for (int i = 0; i < (n); i++) ni(a[i])
#define nal(a, n) for (int i = 0; i < (n); i++) nl(a[i])
#define pri(n) printf("%d\n", (n))
#define prl(n) printf("%I64d\n", (n))
#define pii pair<int, int>
#define pil pair<int, long long>
#define pll pair<long long, long long>
#define vii vector<pii>
#define vil vector<pil>
#define vll vector<pll>
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef cc_hash_table<int,int,hash<int>> ht;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> oset;
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e6 + 5;
const double eps = 1e-9;
int n, m, mrk[MAXN], seg1[MAXN], seg2[MAXN];
int st[MAXN], en[MAXN], sz[MAXN], t = 0, lca[MAXN];
int lz[MAXN], par[20][MAXN], dp1[MAXN];
int cnt[MAXN], sm[MAXN];
vii adj[MAXN], tmp[MAXN], adj2[MAXN];

void build(int l, int r, int k) {
	if (l == r) {
		seg1[k] = 1, seg2[k] = -INF;
		return;
	}
	int m = (l + r) / 2;
	build(l, m, k*2);
	build(m+1, r, k*2+1);
	seg1[k] = seg1[k*2] + seg1[k*2+1];
	seg2[k] = -INF;
}

void prop(int l, int r, int k) {
	if (l != r) {
		seg2[k*2] += lz[k];
		seg2[k*2+1] += lz[k];
		lz[k*2] += lz[k];
		lz[k*2+1] += lz[k];
	}
	lz[k] = 0;
}

void upd(int l, int r, int k, int a, int b, int v, bool fl) {
	if (b < l || r < a) return;
	prop(l, r, k);
	if (a <= l && r <= b) {
		if (fl)
			seg2[k] = v;
		else {
			seg2[k] += v;
			lz[k] = v;
		}
		return;
	}
	int m = (l + r) / 2;
	upd(l, m, k*2, a, b, v, fl);
	upd(m+1, r, k*2+1, a, b, v, fl);
	seg1[k] = 0;
	seg2[k] = max(seg2[k*2], seg2[k*2+1]);
	if (seg2[k] == seg2[k*2])
		seg1[k] += seg1[k*2];
	if (seg2[k] == seg2[k*2+1])
		seg1[k] += seg1[k*2+1];
}

int qry(int l, int r, int k, int a, int b) {
	if (b < l || r < a) return 0;
	prop(l, r, k);
	if (a <= l && r <= b) {
		if (seg2[k] == seg2[1])
			return seg1[k];
		return 0;
	}
	int m = (l + r) / 2;
	return qry(l,m,k*2,a,b) + qry(m+1,r,k*2+1,a,b);
}

void upd2(int u, int v, int l) {
	cnt[l]++;
	sm[l] -= 2;
	sm[u]++;
	sm[v]++;
}

void dfs1(int u, int p, int d) {
	st[u] = t++;
	sz[u] = mrk[u];
	lca[u] = -1;
	if (mrk[u])
		upd(0, 2*n, 1, st[u], st[u], d, 1);
	for (int i = 1; i < 20; i++)
		par[i][u] = par[i-1][par[i-1][u]];
	for (pii nx: adj[u]) {
		if (nx.fi == p)
			continue;
		par[0][nx.fi] = u;
		dfs1(nx.fi, u, d + nx.se);
		if (sz[nx.fi] > 0) {
			sz[u] += sz[nx.fi];
			dp1[u] = max(dp1[u], dp1[nx.fi] + nx.se);
			tmp[u].pb(nx);
		}
	}
	int cnt = 0;
	sort(tmp[u].begin(), tmp[u].end(), [](pii l, pii r) {
		return dp1[l.fi] + l.se > dp1[r.fi] + r.se;
	});
	for (int i = 0; i < tmp[u].size(); i++) {
		if (dp1[u] == dp1[tmp[u][i].fi] + tmp[u][i].se) {
			cnt++;
			lca[u] = lca[tmp[u][i].fi];
			adj2[u].pb(tmp[u][i]);
		} else break;
	}
	if (cnt > 1 || (cnt == 0 && mrk[u]))
		lca[u] = u;
	en[u] = t++;
}

void dfs2(int u, int p) {
	int val = qry(0,2*n,1,st[u],en[u]);
	if (mrk[u] && val > 0) {
		if (adj2[u].size() == 1 && val == seg1[1])
			upd2(lca[adj2[u][0].fi], u, u);
	} else if (mrk[u]) {
		int v = u;
		for (int i = 19; i > -1; i--)
			if (qry(0,2*n,1,st[par[i][v]],en[par[i][u]]) == 0)
				v = par[i][v];
		int to = v;
		v = par[0][v];
		if (qry(0,2*n,1,st[v],en[v]) == seg1[1]) {
			if (tmp[v].size() != 1) {
				int a=tmp[v][0].fi, b=tmp[v][1].fi, c, fl = 0;
				if (a == to) swap(a, b);
				if (tmp[v].size() > 2) {
					c = tmp[v][2].fi;
					if (b == to) swap(b, c);
					if (dp1[a] == dp1[b])
						fl = 1;
				}
				if (!fl)
					upd2(u, lca[a], v);
				else
					upd2(u, v, v);
			} else upd2(u, v, v);
		} else upd2(u, v, v);
	}
	for (pii nx: tmp[u]) {
		upd(0,2*n,1,st[nx.fi],en[nx.fi],-2*nx.se,0);
		dfs2(nx.fi, u);
		upd(0,2*n,1,st[nx.fi],en[nx.fi],2*nx.se,0);
	}
}

pii ans = {0, 0};

void dfs3(int u, int p) {
	for (pii nx: adj[u]) {
		if (nx.fi == p)
			continue;
		dfs3(nx.fi, u);
		sm[u] += sm[nx.fi];
	}
	cnt[u] += sm[u];
	if (!mrk[u] && ans.fi < cnt[u])
		ans = {cnt[u], 1};
	else if (!mrk[u] && ans.fi == cnt[u])
		ans.se++;
}

int main() {
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++) {
		int u; ni(u); u--;
		mrk[u] = 1;
	}
	for (int i = 1; i < n; i++) {
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		a--, b--;
		adj[a].pb({b, c});
		adj[b].pb({a, c});
	}
	build(0, 2*n, 1);
	dfs1(0, -1, 0);
	dfs2(0, -1);
	dfs3(0, -1);
	printf("%d %d\n", ans.fi, ans.se);
    return 0;
}
