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 inft = 1000000009;
const int mod = 1000000007;
const int MAXN = 1000006;
int M[MAXN], MM[MAXN];
pair<int, int> E[MAXN], dist[MAXN];
int di[MAXN];
int C[MAXN];
vector<int> V[MAXN];
int xo(pair<int, int> d) { return d.first ^ d.second; }
int dfs(int a, int s) {
  int p, ret = -inft;
  for (typeof((V[a]).begin()) it = (V[a]).begin(); it != (V[a]).end(); ++it)
    if ((p = xo(E[*it]) ^ a) != s) {
      ret = max(ret, C[*it] + dfs(p, a));
    }
  if (MM[a]) ret = max(0, ret);
  return di[a] = ret;
}
void dfs2(int a, int s, int up) {
  int p;
  pair<int, int> B(-1, -1);
  for (typeof((V[a]).begin()) it = (V[a]).begin(); it != (V[a]).end(); ++it)
    if ((p = xo(E[*it]) ^ a) != s) {
      if (di[p] + C[*it] > B.first) {
        B.second = B.first;
        B.first = di[p] + C[*it];
      } else
        B.second = max(B.second, di[p] + C[*it]);
    }
  for (typeof((V[a]).begin()) it = (V[a]).begin(); it != (V[a]).end(); ++it)
    if ((p = xo(E[*it]) ^ a) != s) {
      if (E[*it].first != a) swap(E[*it].first, E[*it].second);
      dist[*it].first = di[p];
      int tem = B.first;
      if (tem == di[p] + C[*it]) tem = B.second;
      dist[*it].second = max(up, tem);
      dfs2(p, a, dist[*it].second + C[*it]);
    }
}
int get(int nr, int v) {
  if (E[nr].first == v) return dist[nr].first + C[nr];
  return dist[nr].second + C[nr];
}
bool procc[MAXN];
void solve() {
  int n, m, aa;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (m); ++i) {
    scanf("%d", &aa);
    aa--;
    MM[aa] = 1;
  }
  for (int i = 0; i < (n - 1); ++i) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    a--;
    b--;
    E[i] = pair<int, int>(a, b);
    C[i] = c;
    V[a].push_back(i);
    V[b].push_back(i);
  }
  dfs(0, -1);
  ;
  for (int i = 0; i < (n); ++i)
    ;
  ;
  dfs2(0, -1, 0);
  for (int i = 0; i < (n - 1); ++i)
    ;
  for (int i = 0; i < (n); ++i) {
    int ret = 0;
    for (typeof((V[i]).begin()) it2 = (V[i]).begin(); it2 != (V[i]).end();
         ++it2) {
      ret = max(ret, get(*it2, i));
    }
    di[i] = ret;
  };
  for (int i = 0; i < (n); ++i)
    ;
  ;
  priority_queue<pair<pair<int, int>, int> > X;
  for (int i = 0; i < (n); ++i)
    if (MM[i]) {
      X.push(make_pair(pair<int, int>(di[i], i), MM[i]));
    }
  while (!X.empty()) {
    pair<pair<int, int>, int> U = X.top();
    X.pop();
    while (!X.empty() && X.top().first == U.first) {
      U.second += X.top().second;
      X.pop();
    };
    int v = -1, ile = 0, u = U.first.second, du;
    ;
    M[u] += U.second;
    for (typeof((V[u]).begin()) it2 = (V[u]).begin(); it2 != (V[u]).end();
         ++it2) {
      if (get(*it2, u) == U.first.first) {
        ile++;
        v = xo(E[*it2]) ^ u;
        du = U.first.first - C[*it2];
      }
    }
    if (ile == 1) {
      ;
      X.push(make_pair(pair<int, int>(du, v), U.second));
    }
  };
  for (int i = 0; i < (n); ++i)
    ;
  ;
  int ret = 0;
  for (int i = 0; i < (n); ++i)
    if (!MM[i]) ret = max(ret, M[i]);
  int ile = 0;
  for (int i = 0; i < (n); ++i)
    if (!MM[i] && ret == M[i]) ile++;
  printf("%d %d\n", ret, ile);
}
int main() {
  int te = 1;
  for (int ti = 0; ti < (te); ++ti) solve();
  return 0;
}
