#include <bits/stdc++.h>
using namespace std;
int l[2005], r[2005];
bool dp[2005][2005];
string s;
void all_palindroms(int n) {
  for (int i = 0; i < n; i++) {
    dp[i][i] = true;
    l[i]++;
    r[i]++;
  }
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == s[i + 1]) {
      dp[i][i + 1] = true;
      l[i]++;
      r[i + 1]++;
    }
  }
  for (int gap = 2; gap < n; gap++) {
    for (int i = 0; i < n - gap; i++) {
      int j = gap + i;
      if (s[i] == s[j] && dp[i + 1][j - 1]) {
        dp[i][j] = true;
        l[i]++;
        r[j]++;
      }
    }
  }
}
int main() {
  int n, i, x, j;
  long long sol = 0;
  ios_base::sync_with_stdio(false);
  cin >> s;
  x = s.size();
  all_palindroms(x);
  for (i = 0; i < x; i++) {
    for (j = i + 1; j < x; j++) {
      sol += (long long)r[i] * l[j];
    }
  }
  cout << sol;
  return 0;
}
