#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, e, f, g, h, i, j, k;
int father[705];
int D[705];
vector<int> GG[705];
struct BigInt {
  int x[105];
  int len;
  void give(int xx) {
    memset(x, 0, sizeof(x));
    len = 1;
    x[1] = xx;
  }
  friend bool operator<(const BigInt &x, const BigInt &y) {
    int ii;
    int L = max(x.len, y.len);
    for (ii = L; ii >= 1; ii--)
      if (x.x[ii] < y.x[ii])
        return true;
      else if (x.x[ii] > y.x[ii])
        return false;
    return false;
  }
  friend BigInt operator+(const BigInt &x, const BigInt &y) {
    int ii, jj, kk;
    int jw = 0;
    int L = max(x.len, y.len);
    BigInt R;
    R.give(0);
    for (ii = 1; ii <= L + 1; ii++) {
      kk = x.x[ii] + y.x[ii] + jw;
      R.x[ii] = kk % 10000;
      jw = kk / 10000;
    }
    if (R.x[L + 1] == 0)
      R.len = L;
    else
      R.len = L + 1;
    return R;
  }
  friend BigInt operator*(const BigInt &x, const BigInt &y) {
    int ii, jj, kk;
    BigInt R;
    R.give(0);
    for (ii = 1; ii <= x.len; ii++)
      for (jj = 1; jj <= y.len; jj++) R.x[ii + jj - 1] += x.x[ii] * y.x[jj];
    for (ii = 1; ii <= x.len + y.len; ii++) {
      R.x[ii + 1] += R.x[ii] / 10000;
      R.x[ii] %= 10000;
    }
    R.len = x.len + y.len;
    while (R.len > 1 && R.x[R.len] == 0) R.len--;
    return R;
  }
};
BigInt F[705][705];
void soso(int x) {
  int ii, jj, kk;
  int cc, dd;
  BigInt tmp;
  BigInt ch;
  ch.give(0);
  D[x] = 1;
  F[x][0].give(0);
  F[x][1].give(1);
  for (ii = 0; ii < GG[x].size(); ii++) {
    jj = GG[x][ii];
    if (jj == father[x]) continue;
    father[jj] = x;
    soso(jj);
    for (cc = D[x]; cc > 0; cc--)
      for (dd = D[jj]; dd >= 0; dd--) {
        tmp = F[x][cc] * F[jj][dd];
        if (F[x][cc + dd] < tmp) F[x][cc + dd] = tmp;
      }
    D[x] += D[jj];
  }
  for (ii = 1; ii <= D[x]; ii++) {
    ch.x[1] = ii;
    tmp = ch * F[x][ii];
    if (F[x][0] < tmp) F[x][0] = tmp;
  }
}
void Print(BigInt x) {
  int ii, jj, kk;
  kk = 100;
  while (kk > 1 && x.x[kk] == 0) kk--;
  cout << x.x[kk];
  for (ii = kk - 1; ii >= 1; ii--) printf("%04d", x.x[ii]);
  cout << endl;
}
int main() {
  cin >> a;
  for (i = 1; i < a; i++) {
    scanf("%d%d", &c, &d);
    GG[c].push_back(d);
    GG[d].push_back(c);
  }
  soso(1);
  Print(F[1][0]);
  return 0;
}
