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 <bits/stdc++.h>
using namespace std;
const int MAXN = 100 * 1000 + 10;
const int LGN = 17;
const int INF = -1000 * 1000 * 1000;
vector<pair<int, int> > g[MAXN];
bool isP[MAXN];
int par[MAXN][LGN];
int h[MAXN];
int dfso[MAXN];
int rdfs[MAXN];
int dfsoc;
void pre_dfs(int u) {
  dfso[u] = dfsoc;
  rdfs[dfsoc] = u;
  dfsoc++;
  for (int i = 1; i < LGN; i++) par[u][i] = par[par[u][i - 1]][i - 1];
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i].first;
    if (v == par[u][0]) {
      swap(g[u][i], g[u].back());
      g[u].pop_back();
      i--;
      continue;
    }
    h[v] = h[u] + 1;
    par[v][0] = u;
    pre_dfs(v);
  }
}
int lca(int u, int v) {
  if (h[u] > h[v]) swap(u, v);
  {
    int x = h[v] - h[u];
    for (int i = LGN - 1; i >= 0; i--)
      if (x & (1 << i)) v = par[v][i];
  }
  if (u == v) return u;
  for (int i = LGN - 1; i >= 0; i--)
    if (par[u][i] != par[v][i]) u = par[u][i], v = par[v][i];
  return par[u][0];
}
struct Cand {
  int d, v;
  Cand() { d = INF; }
  bool operator<(const Cand& c) const {
    if (c.d == d) assert(0);
    return d < c.d;
  }
};
Cand dp[MAXN];
void dfs(int u) {
  Cand& me = dp[u];
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i].first;
    dfs(v);
    Cand c = dp[v];
    if (c.d == INF) continue;
    c.d += g[u][i].second;
    if (c.d == me.d)
      me.v = u;
    else
      me = max(me, c);
  }
  if (isP[u] && me.d == INF) me.d = 0, me.v = u;
}
int smb[MAXN];
int sma[MAXN];
void dfs2(int u, Cand up, int w) {
  if (up.d != INF) up.d += w;
  if (isP[u] && up.d != dp[u].d) {
    Cand cc = max(up, dp[u]);
    int x = cc.v;
    smb[x]++;
    smb[u]++;
    int y = lca(x, u);
    smb[y]--;
    sma[y]--;
  }
  vector<Cand> vv(g[u].size());
  if (isP[u] && up.d == INF) up.d = 0, up.v = u;
  Cand tmp = up;
  for (int i = 0; i < g[u].size(); i++) {
    vv[i] = tmp;
    int v = g[u][i].first;
    Cand c = dp[v];
    if (c.d == INF) continue;
    c.d += g[u][i].second;
    if (c.d == tmp.d)
      tmp.v = u;
    else
      tmp = max(tmp, c);
  }
  tmp = Cand();
  for (int i = g[u].size() - 1; i >= 0; i--) {
    int v = g[u][i].first;
    if (tmp.d == vv[i].d)
      vv[i].v = u;
    else
      vv[i] = max(vv[i], tmp);
    dfs2(v, vv[i], g[u][i].second);
    Cand c = dp[v];
    if (c.d == INF) continue;
    c.d += g[u][i].second;
    if (c.d == tmp.d)
      tmp.v = u;
    else
      tmp = max(tmp, c);
  }
}
int bst = 0, ways = 0;
int dfs3(int u) {
  int me = smb[u];
  for (int i = 0; i < g[u].size(); i++) me += dfs3(g[u][i].first);
  if (!isP[u]) {
    if (me > bst) bst = me, ways = 0;
    if (me == bst) ways++;
  }
  me += sma[u];
  return me;
}
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    isP[x] = true;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    g[u].push_back(make_pair(v, w));
    g[v].push_back(make_pair(u, w));
  }
  par[1][0] = 1;
  pre_dfs(1);
  dfs(1);
  dfs2(1, Cand(), 0);
  dfs3(1);
  cout << bst << ' ' << ways << endl;
  return 0;
}
