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;
int n, m;
struct node {
  int otec, distup, dootca;
  pair<int, int> distdown[2];
  int preslo, up, down;
  int mon, monund;
  vector<pair<int, int> > sus;
  node() {
    otec = -1;
    preslo = 0;
    distdown[0].first = distdown[1].first = distup = -1;
    mon = 0;
    monund = 0;
    up = 0;
    down = 0;
  }
};
vector<node> strom;
void init_dfs(int node, int ot) {
  strom[node].otec = ot;
  if (strom[node].mon) {
    strom[node].monund++;
    strom[node].distdown[0] = pair<int, int>(0, -1);
  }
  pair<int, int> dole[2];
  for (int i = 0; i < strom[node].sus.size(); i++) {
    pair<int, int> pop = strom[node].sus[i];
    int on = pop.first;
    if (on == ot) continue;
    strom[on].dootca = pop.second;
    init_dfs(on, node);
    strom[node].monund += strom[on].monund;
    if (strom[on].monund) {
      pair<int, int> pom =
          pair<int, int>(strom[on].distdown[0].first + pop.second, on);
      if (pom > strom[node].distdown[1]) {
        strom[node].distdown[1] = pom;
        if (strom[node].distdown[1] > strom[node].distdown[0])
          swap(strom[node].distdown[1], strom[node].distdown[0]);
      }
    }
  }
}
void updist_dfs(int node) {
  int ot = strom[node].otec;
  int doot = strom[node].dootca;
  if (strom[node].monund != m) {
    strom[node].distup = strom[ot].distup + doot;
    pair<int, int> pom = strom[ot].distdown[0];
    if (pom.second == node) pom = strom[ot].distdown[1];
    if (pom.first != -1)
      strom[node].distup = max(strom[node].distup, doot + pom.first);
  }
  for (int i = 0; i < strom[node].sus.size(); i++) {
    int on = strom[node].sus[i].first;
    if (on != ot) updist_dfs(on);
  }
}
void upsweep_dfs(int node) {
  int ot = strom[node].otec;
  for (int i = 0; i < strom[node].sus.size(); i++) {
    pair<int, int> pop = strom[node].sus[i];
    int on = pop.first;
    if (on == ot) continue;
    upsweep_dfs(on);
  }
  if (strom[node].mon) {
    strom[node].preslo++;
    if (strom[node].distup > strom[node].distdown[0].first)
      strom[node].up++;
    else {
      if (strom[node].distdown[0].first >
          max(strom[node].distdown[1].first, strom[node].distup)) {
        int on = strom[node].distdown[0].second;
        if (on >= 0) {
          strom[on].down++;
          strom[on].preslo++;
        }
      }
    }
  }
  if (ot == -1 || strom[node].up == 0) return;
  strom[ot].preslo += strom[node].up;
  pair<int, int> pom = strom[ot].distdown[0];
  if (pom.second == node) pom = strom[ot].distdown[1];
  if (pom.first > strom[ot].distup) {
    if (pom.second >= 0) {
      strom[pom.second].preslo += strom[node].up;
      strom[pom.second].down += strom[node].up;
    }
  }
  if (pom.first < strom[ot].distup) strom[ot].up += strom[node].up;
}
void downsweep_dfs(int node) {
  pair<int, int> cur = strom[node].distdown[0];
  if (cur.first > 0) {
    int on = cur.second;
    strom[on].preslo += strom[node].down;
    strom[on].down += strom[node].down;
  }
  for (int i = 0; i < strom[node].sus.size(); i++) {
    int on = strom[node].sus[i].first;
    if (on != strom[node].otec) {
      downsweep_dfs(on);
    }
  }
}
int main() {
  scanf("%d %d", &n, &m);
  strom.resize(n);
  for (int i = 0; i < m; i++) {
    int pom;
    scanf("%d", &pom);
    pom--;
    strom[pom].mon = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    a--;
    b--;
    strom[a].sus.push_back(pair<int, int>(b, c));
    strom[b].sus.push_back(pair<int, int>(a, c));
  }
  init_dfs(0, -1);
  updist_dfs(0);
  upsweep_dfs(0);
  downsweep_dfs(0);
  int maximum = -1, pocet = 0;
  for (int i = 0; i < n; i++) {
    if (strom[i].mon) continue;
    if (strom[i].preslo == maximum) pocet++;
    if (strom[i].preslo > maximum) {
      maximum = strom[i].preslo;
      pocet = 1;
    }
  }
  printf("%d %d\n", maximum, pocet);
  return 0;
}
