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>
template <typename T, typename _T>
inline bool chk_min(T &x, const _T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T, typename _T>
inline bool chk_max(T &x, const _T y) {
  return x < y ? x = y, 1 : 0;
}
const int N = 100005;
template <const int N, const int M, typename T>
struct LinkedList {
  int head[N], nxt[M], tot;
  T to[M];
  LinkedList() { clear(); }
  T &operator[](const int x) { return to[x]; }
  void clear() { memset(head, -1, sizeof(head)), tot = 0; }
  void add(int u, T v) { to[tot] = v, nxt[tot] = head[u], head[u] = tot++; }
};
struct edge {
  int to, cost;
};
int n, m;
namespace Subtask1 {
LinkedList<N, N << 1, edge> G;
const int N = 1005;
int dis[N][N];
int frd[N][N], cnt[N];
bool mrk[N];
void dfs(int u, int f, int D, int U) {
  dis[U][u] = D;
  for (int i = G.head[u]; ~i; i = G.nxt[i]) {
    int v = G[i].to, w = G[i].cost;
    if (v == f) continue;
    dfs(v, u, D + w, U);
  }
}
void Solve() {
  for (int i = (1), iEND = (m); i <= iEND; ++i) {
    int x;
    scanf("%d", &x);
    mrk[x] = 1;
  }
  for (int i = (1), iEND = (n - 1); i <= iEND; ++i) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    G.add(u, (edge){v, w}), G.add(v, (edge){u, w});
  }
  for (int i = (1), iEND = (n); i <= iEND; ++i) dfs(i, 0, 0, i);
  for (int i = (1), iEND = (n); i <= iEND; ++i)
    if (mrk[i]) {
      int d = 0;
      for (int j = (1), jEND = (n); j <= jEND; ++j)
        if (mrk[j] && j != i) chk_max(d, dis[i][j]);
      for (int j = (1), jEND = (n); j <= jEND; ++j)
        if (mrk[j] && j != i && dis[i][j] == d) frd[i][++cnt[i]] = j;
    }
  int ans = 0, sum = 0;
  for (int k = (1), kEND = (n); k <= kEND; ++k)
    if (!mrk[k]) {
      int res = 0;
      for (int u = (1), uEND = (n); u <= uEND; ++u)
        if (mrk[u]) {
          bool flg = 1;
          for (int i = (1), iEND = (cnt[u]); i <= iEND; ++i) {
            int v = frd[u][i];
            if (dis[u][v] != dis[u][k] + dis[k][v]) {
              flg = 0;
              break;
            }
          }
          res += flg;
        }
      if (chk_max(ans, res))
        sum = 1;
      else if (ans == res)
        sum++;
    }
  printf("%d %d\n", ans, sum);
}
};  // namespace Subtask1
namespace Subtask2 {
LinkedList<N, N << 1, edge> G;
int arr[N];
bool mrk[N];
int dx, dy, Dis;
int dim[N], S[N], len, did[N];
int sz[N], mxdown[N];
int stat[N];
void dfs(int u, int f, int D, int &x, int &Dis) {
  if (mrk[u] && chk_max(Dis, D)) x = u;
  for (int i = G.head[u]; ~i; i = G.nxt[i]) {
    int v = G[i].to, w = G[i].cost;
    if (v == f) continue;
    dfs(v, u, D + w, x, Dis);
  }
}
bool draw(int u, int f, int D, int gl) {
  dim[++len] = u, S[len] = D;
  if (u == gl) return true;
  for (int i = G.head[u]; ~i; i = G.nxt[i]) {
    int v = G[i].to, w = G[i].cost;
    if (v == f) continue;
    if (draw(v, u, D + w, gl)) return true;
  }
  len--;
  return false;
}
void redfs(int u, int f) {
  sz[u] = mrk[u], mxdown[u] = (mrk[u] ? 0 : -1e9);
  for (int i = G.head[u]; ~i; i = G.nxt[i]) {
    int v = G[i].to, w = G[i].cost;
    if (v == f || did[v]) continue;
    redfs(v, u);
    sz[u] += sz[v];
    chk_max(mxdown[u], mxdown[v] + w);
  }
}
void Solve() {
  for (int i = (1), iEND = (m); i <= iEND; ++i)
    scanf("%d", &arr[i]), mrk[arr[i]] = 1;
  for (int i = (1), iEND = (n - 1); i <= iEND; ++i) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    G.add(u, (edge){v, w}), G.add(v, (edge){u, w});
  }
  dfs(arr[1], 0, 0, dx, Dis = -1);
  dfs(dx, 0, 0, dy, Dis = -1);
  draw(dx, 0, 0, dy);
  for (int i = (1), iEND = (len); i <= iEND; ++i) did[dim[i]] = i;
  for (int i = (1), iEND = (len); i <= iEND; ++i) redfs(dim[i], 0);
  for (int i = (1), iEND = (n); i <= iEND; ++i)
    if (!mrk[i]) stat[i] = sz[i];
  int sum = 0;
  for (int i = (1), iEND = (len); i <= iEND; ++i) {
    if (!mrk[dim[i]]) stat[dim[i]] += sum;
    sum += sz[dim[i]];
    if (S[i] - S[1] >= S[len] - S[i]) break;
  }
  sum = 0;
  for (int i = (len), iEND = (1); i >= iEND; --i) {
    if (!mrk[dim[i]]) stat[dim[i]] += sum;
    sum += sz[dim[i]];
    if (S[len] - S[i] >= S[i] - S[1]) break;
  }
  int ans = 0;
  sum = 0;
  for (int i = (1), iEND = (n); i <= iEND; ++i)
    if (!mrk[i]) {
      if (chk_max(ans, stat[i]))
        sum = 1;
      else if (ans == stat[i])
        sum++;
    }
  printf("%d %d\n", ans, sum);
}
};  // namespace Subtask2
int main() {
  scanf("%d%d", &n, &m);
  Subtask2::Solve();
  return 0;
}
