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 M = (int)1e5 + 5;
void Max(int &x, int y) {
  if (x < y) x = y;
}
struct W {
  int to, nx, d;
} Lis[M * 2];
int Head[M], tot;
void Add(int x, int y, int d) {
  Lis[++tot] = (W){y, Head[x], d};
  Head[x] = tot;
}
int n, m;
int mark[M], fa[M], cntson[M];
int disdown[M], disup[M], dismx[M], disse[M];
int disdownmxcnt[M], disdownmxto[M], dismxcnt[M], dismxto[M][2], dissecnt[M],
    disseto[M];
void dfs(int x, int f) {
  cntson[x] = mark[x];
  fa[x] = f;
  for (int i = Head[x], to; i && (to = Lis[i].to, 1); i = Lis[i].nx)
    if (to != f) {
      dfs(to, x);
      if (cntson[to])
        Max(disdown[x], disdown[to] + Lis[i].d), cntson[x] += cntson[to];
    }
}
void rdfs(int x, int f) {
  int mx = disup[x], id = 0, se = 0;
  for (int i = Head[x], to; i && (to = Lis[i].to, 1); i = Lis[i].nx)
    if (to != f) {
      static int ll;
      ll = disdown[to] + Lis[i].d;
      if (cntson[to] == 0)
        ;
      else if (ll > mx)
        se = mx, mx = ll, id = to;
      else if (ll > se)
        se = ll;
    }
  for (int i = Head[x], to; i && (to = Lis[i].to, 1); i = Lis[i].nx)
    if (to != f) {
      if (m == cntson[to])
        ;
      else if (to != id)
        disup[to] = mx + Lis[i].d;
      else
        disup[to] = se + Lis[i].d;
      rdfs(to, x);
    }
}
int cntdown[M];
vector<pair<int, int> > up[M];
int ansdown[M], ansup[M];
void dfs_up(int x, int f) {
  for (int i = Head[x], to; i && (to = Lis[i].to, 1); i = Lis[i].nx)
    if (to != f) dfs_up(to, x);
  int UP_F = 0;
  for (int i = 0, Up = up[x].size(); i < Up; i++) {
    static pair<int, int> tmp;
    static int to;
    tmp = up[x][i];
    to = tmp.second;
    ansup[x] += tmp.first;
    if (dismxcnt[x] > 2)
      ;
    else if (dismxcnt[x] == 2) {
      if (to == dismxto[x][0]) {
        if (dismxto[x][1] == fa[x])
          UP_F += tmp.first;
        else
          cntdown[dismxto[x][1]] += tmp.first;
      } else if (to == dismxto[x][1]) {
        cntdown[dismxto[x][0]] += tmp.first;
      }
    } else if (dismxcnt[x] == 1) {
      if (to == dismxto[x][0]) {
        if (dissecnt[x] == 1) {
          if (disseto[x] == fa[x])
            UP_F += tmp.first;
          else
            cntdown[disseto[x]] += tmp.first;
        }
      } else {
        if (dismxto[x][0] == fa[x])
          UP_F += tmp.first;
        else
          cntdown[dismxto[x][0]] += tmp.first;
      }
    }
  }
  if (UP_F) up[fa[x]].push_back(pair<int, int>(UP_F, x));
}
void dfs_down(int x, int f) {
  ansdown[x] = cntdown[x];
  if (dismxcnt[x] == 2) {
    if (dismxto[x][1] == fa[x]) {
      cntdown[dismxto[x][0]] += cntdown[x];
    }
  } else if (dismxcnt[x] == 1) {
    cntdown[dismxto[x][0]] += cntdown[x];
  }
  for (int i = Head[x], to; i && (to = Lis[i].to, 1); i = Lis[i].nx)
    if (to != f) dfs_down(to, x);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1, x; i <= m; i++) scanf("%d", &x), mark[x] = 1;
  for (int i = 1, x, y, d; i < n; i++)
    scanf("%d %d %d", &x, &y, &d), Add(x, y, d), Add(y, x, d);
  dfs(1, 1), rdfs(1, 1);
  for (int x = 1; x <= n; x++) {
    dismx[x] = max(disdown[x], disup[x]);
    for (int i = Head[x], to; i && (to = Lis[i].to, 1); i = Lis[i].nx)
      if (to != fa[x] && cntson[to]) {
        static int ll;
        ll = disdown[to] + Lis[i].d;
        if (ll == disdown[x]) {
          disdownmxcnt[x]++;
          disdownmxto[x] = to;
        }
        if (ll == dismx[x]) {
          if (dismxcnt[x] < 2) dismxto[x][dismxcnt[x]] = to;
          dismxcnt[x]++;
        } else if (ll > disse[x]) {
          disse[x] = ll;
          dissecnt[x] = 1;
          disseto[x] = to;
        } else if (ll == disse[x]) {
          dissecnt[x]++;
        }
      }
    if (m == cntson[fa[x]])
      ;
    else if (disup[x] == dismx[x]) {
      if (dismxcnt[x] < 2) dismxto[x][dismxcnt[x]] = fa[x];
      dismxcnt[x]++;
    } else if (disup[x] > disse[x]) {
      disse[x] = disup[x];
      dissecnt[x] = 1;
      disseto[x] = fa[x];
    } else if (disup[x] == disse[x]) {
      dissecnt[x]++;
    }
  }
  for (int x = 1; x <= n; x++)
    if (mark[x] && dismxcnt[x] == 1) {
      if (dismxto[x][0] == fa[x]) {
        up[fa[x]].push_back(pair<int, int>(1, x));
      } else {
        cntdown[x]++;
      }
    }
  dfs_up(1, 1), dfs_down(1, 1);
  int ans = 0, cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (mark[i]) continue;
    ansdown[i] += ansup[i];
    if (ansdown[i] > ans) ans = ansdown[i], cnt = 0;
    if (ansdown[i] == ans) cnt++;
  }
  printf("%d %d\n", ans, cnt);
  return 0;
}
