#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;
}
