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;
template <class T, class L>
bool smax(T& x, L y) {
  return x < y ? (x = y, 1) : 0;
}
template <class T, class L>
bool smin(T& x, L y) {
  return y < x ? (x = y, 1) : 0;
}
const int maxn = 1e5 + 17, lg = 17, inf = 17171717;
struct edge {
  int u, w;
};
struct joje {
  int s, e, x;
  bool operator<(const joje& j) { return x < j.x; }
};
struct wet {
  joje a, b;
  wet() { a.x = b.x = -inf; }
  void add(joje x) {
    if (a < x)
      b = a, a = x;
    else
      smax(b, x);
  }
  joje& get(int v) {
    if (v == a.s) return b;
    return a;
  }
} p[maxn];
int n, m, ans[maxn], h[maxn], par[maxn][lg];
vector<edge> g[maxn];
bool morshed[maxn];
int jade_moshtarak(int v, int u) {
  if (h[u] < h[v]) swap(v, u);
  for (int i = 0; i < lg; i++)
    if ((h[u] - h[v]) >> i & 1) u = par[u][i];
  if (v == u) return v;
  for (int i = lg - 1; i >= 0; i--)
    if (par[v][i] != par[u][i]) v = par[v][i], u = par[u][i];
  return *par[v];
}
void f_your_parent(int v = 0, int p = -1) {
  for (int i = 0; i < g[v].size(); i++)
    if (g[v][i].u == p)
      swap(g[v][i], g[v].back()), g[v].pop_back(), i--;
    else
      f_your_parent(g[v][i].u, v);
}
void make_amirjoon_happy(int v = 0) {
  for (int i = 1; i < lg; i++) par[v][i] = par[par[v][i - 1]][i - 1];
  for (auto amir : g[v]) {
    h[amir.u] = h[v] + 1;
    *par[amir.u] = v;
    make_amirjoon_happy(amir.u);
  }
}
joje go_down(int v = 0) {
  if (morshed[v]) p[v].add({-1, v, 0});
  for (auto amir : g[v]) {
    joje back = go_down(amir.u);
    back.s = amir.u, back.x += amir.w;
    p[v].add(back);
  }
  joje ans = p[v].a;
  if (p[v].a.x == p[v].b.x) ans.e = v;
  return ans;
}
void dasmali(int from, int to) {
  int bache = jade_moshtarak(from, to);
  ans[from]++, ans[to]++, ans[bache]--;
  ans[*par[bache]]--;
}
void go_up(int v = 0, joje love = {-1, -1, -inf}) {
  wet w;
  w.add(love), w.add(love);
  smax(w.a, p[v].a);
  if (love.x == p[v].a.x) w.a.e = v;
  smax(w.b, p[v].b);
  if (love.x == p[v].b.x) w.b.e = v;
  if (morshed[v]) dasmali(v, w.a.e);
  for (auto amir : g[v]) {
    joje foryou = w.get(amir.u);
    go_up(amir.u, {foryou.s, foryou.e, foryou.x + amir.w});
  }
}
void keep_calm_and_go_home(int v = 0) {
  for (auto amir : g[v]) keep_calm_and_go_home(amir.u), ans[v] += ans[amir.u];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> m;
  for (int v; m--;) cin >> v, morshed[--v] = 1;
  for (int i = 1, v, u, w; i < n; i++)
    cin >> v >> u >> w, g[--v].push_back({--u, w}), g[u].push_back({v, w});
  **par = n;
  f_your_parent();
  make_amirjoon_happy();
  go_down();
  go_up();
  keep_calm_and_go_home();
  int res = 0, cnt = 0;
  for (int i = 0; i < n; i++)
    if (!morshed[i])
      if (smax(res, (!morshed[i]) * ans[i]))
        cnt = 1;
      else if (res == (!morshed[i]) * ans[i])
        cnt++;
  cout << res << ' ' << cnt << '\n';
  return 0;
}
