#include <bits/stdc++.h>
using namespace std;
long long dp[2000 + 10], st[2000 + 10];
bool palindrome[2000 + 10][2000 + 10];
int i, j;
long long ans;
string s;
int main() {
  cin >> s;
  for (i = 0; i < s.length() - 1; i++) {
    palindrome[i][i] = 1;
    palindrome[i][i + 1] = (s[i] == s[i + 1]);
  }
  palindrome[s.length() - 1][s.length() - 1] = 1;
  for (j = 2; j < s.length(); j++) {
    for (i = 0; i + j < s.length(); i++) {
      palindrome[i][i + j] = palindrome[i + 1][j + i - 1] && s[i] == s[i + j];
    }
  }
  for (i = 0; i < s.length(); i++) {
    for (j = i; j < s.length(); j++) st[i] += palindrome[i][j];
  }
  dp[s.length() - 1] = 1;
  for (i = s.length() - 2; i >= 0; i--) {
    dp[i] = dp[i + 1] + st[i];
  }
  for (i = 0; i < s.length(); i++) {
    for (j = i; j < s.length(); j++) {
      if (palindrome[i][j]) ans += dp[j + 1];
    }
  }
  cout << ans;
}
