#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
unordered_map<long long, int> endspot, l;
unordered_map<long long, bool> visited;
pair<int, int> best[MAXN][3];
vector<int> edges[MAXN];
int pilg[MAXN];
int n, m;
set<int> notdone[MAXN];
int dfsorder[MAXN], tree[8 * MAXN], revdfs[MAXN];
int ct = 0;
vector<int> euler;
int firsttime[MAXN];
int partpl[MAXN], partmi[MAXN];
int ans[MAXN];
int part = 0;
bool ispilg[MAXN];
int ___dist[MAXN];
void dfs(int f, int v) {
  dfsorder[v] = ct;
  revdfs[ct] = v;
  ++ct;
  euler.push_back(dfsorder[v]);
  firsttime[v] = euler.size() - 1;
  for (int i = 0; i < edges[v].size(); ++i) {
    if (f != edges[v][i]) {
      ___dist[edges[v][i]] = ___dist[v] + 1;
      dfs(v, edges[v][i]);
      euler.push_back(dfsorder[v]);
    }
  }
}
void init(int l = 0, int r = 2 * n - 2, int node = 1) {
  if (l == r) {
    tree[node] = euler[l];
    return;
  }
  int mid = (l + r) / 2;
  init(l, mid, 2 * node);
  init(mid + 1, r, 2 * node + 1);
  tree[node] = min(tree[2 * node], tree[2 * node + 1]);
}
int lca(int a, int b, int l = 0, int r = 2 * n - 2, int node = 1) {
  if (a == l && b == r) return tree[node];
  int mid = (l + r) / 2;
  if (b <= mid) return lca(a, b, l, mid, 2 * node);
  if (a >= mid + 1) return lca(a, b, mid + 1, r, 2 * node + 1);
  return min(lca(a, mid, l, mid, 2 * node),
             lca(mid + 1, b, mid + 1, r, 2 * node + 1));
}
void update(int x, int v) {
  if (!ispilg[v] &&
      ((best[v][0] == pair<int, int>(0, v)) ||
       (best[v][0].second == x && best[v][1] == pair<int, int>(0, v))))
    return;
  if (best[v][0].second == x) {
    if (best[v][1].first == best[v][2].first)
      endspot[1LL * MAXN * x + v] = v;
    else
      endspot[1LL * MAXN * x + v] = endspot[1LL * MAXN * v + best[v][1].second];
    int lx = l[1LL * MAXN * x + v] + best[v][1].first;
    pair<int, int> xl = {lx, v};
    for (int i = 0; i < 3; ++i) {
      if (xl > best[x][i]) {
        for (int j = 2; j >= i + 1; --j) best[x][j] = best[x][j - 1];
        best[x][i] = xl;
        break;
      }
    }
  } else if (best[v][1].second == x) {
    if (best[v][0].first == best[v][2].first)
      endspot[1LL * MAXN * x + v] = v;
    else
      endspot[1LL * MAXN * x + v] = endspot[1LL * MAXN * v + best[v][0].second];
    int lx = l[1LL * MAXN * x + v] + best[v][0].first;
    pair<int, int> xl = {lx, v};
    for (int i = 0; i < 3; ++i) {
      if (xl > best[x][i]) {
        for (int j = 2; j >= i + 1; --j) best[x][j] = best[x][j - 1];
        best[x][i] = xl;
        break;
      }
    }
  } else {
    if (best[v][0].first == best[v][1].first)
      endspot[1LL * MAXN * x + v] = v;
    else
      endspot[1LL * MAXN * x + v] = endspot[1LL * MAXN * v + best[v][0].second];
    int lx = l[1LL * MAXN * x + v] + best[v][0].first;
    pair<int, int> xl = {lx, v};
    for (int i = 0; i < 3; ++i) {
      if (xl > best[x][i]) {
        for (int j = 2; j >= i + 1; --j) best[x][j] = best[x][j - 1];
        best[x][i] = xl;
        break;
      }
    }
  }
}
void compute(int x, int v) {
  if (visited.count(1LL * MAXN * x + v) > 0) return;
  visited[1LL * MAXN * x + v] = 1;
  while (!notdone[v].empty() && *notdone[v].begin() != x) {
    compute(v, *notdone[v].begin());
    notdone[v].erase(*notdone[v].begin());
  }
  while (!notdone[v].empty() && *notdone[v].rbegin() != x) {
    compute(v, *notdone[v].rbegin());
    notdone[v].erase(*notdone[v].rbegin());
  }
  update(x, v);
}
int finishdfs(int f, int v) {
  int tot = 0;
  for (int i = 0; i < edges[v].size(); ++i) {
    if (f != edges[v][i]) {
      tot += finishdfs(v, edges[v][i]);
    }
  }
  tot += partpl[v];
  ans[v] += tot;
  tot -= partmi[v];
  return tot;
}
int main() {
  ios_base::sync_with_stdio(0);
  memset(partpl, 0, sizeof(partpl));
  memset(partmi, 0, sizeof(partmi));
  memset(ans, 0, sizeof(ans));
  memset(ispilg, 0, sizeof(ispilg));
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> pilg[i];
    pilg[i]--;
    ispilg[pilg[i]] = true;
  }
  for (int i = 0; i < n - 1; ++i) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    int l3;
    cin >> l3;
    edges[x].push_back(y);
    edges[y].push_back(x);
    notdone[x].insert(y);
    notdone[y].insert(x);
    l[1LL * MAXN * x + y] = l[1LL * MAXN * y + x] = l3;
  }
  for (int i = 0; i < n; ++i) {
    best[i][0] = best[i][1] = best[i][2] = {0, i};
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < edges[i].size(); ++j) compute(i, edges[i][j]);
  ___dist[0] = 0;
  dfs(-1, 0);
  init();
  for (int i = 0; i < m; ++i) {
    int p = pilg[i], q;
    if (best[p][0].first == best[p][1].first) {
      q = p;
    } else
      q = endspot[1LL * MAXN * p + best[p][0].second];
    if (p == q) continue;
    if (firsttime[p] > firsttime[q]) swap(p, q);
    int lcapq = revdfs[lca(firsttime[p], firsttime[q])];
    if (lcapq == p) {
      partpl[q]++;
      partmi[p]++;
    } else {
      partpl[p]++;
      partpl[q]++;
      partmi[lcapq] += 2;
      ans[lcapq]--;
    }
  }
  finishdfs(-1, 0);
  int maxi = -1, maxct = -1;
  for (int i = 0; i < n; ++i) {
    if (ispilg[i]) continue;
    if (ans[i] == maxi) ++maxct;
    if (ans[i] > maxi) {
      maxi = ans[i];
      maxct = 1;
    }
  }
  if (m == 2) {
    if (firsttime[pilg[0]] > firsttime[pilg[1]]) swap(pilg[0], pilg[1]);
    int lcapq = revdfs[lca(firsttime[pilg[0]], firsttime[pilg[1]])];
    int dist1 = ___dist[pilg[0]] + ___dist[pilg[1]] - 2 * ___dist[lcapq] + 1;
    if (dist1 == 2)
      cout << "0 " << n - 2 << endl;
    else
      cout << "2 " << dist1 - 2 << endl;
    return 0;
  }
  cout << maxi << ' ' << maxct << endl;
}
